OpenTP1 Version 7 Programming Reference C Language

[Contents][Index][Back][Next]

dc_logprint - Output message log

Format

ANSI C, C++

#include <dclog.h>
int  dc_logprint (char *msgid, char *pgm_id, char *string,
                  char *info, DCLONG color, DCLONG flags)

K&R C

#include <dclog.h>
int  dc_logprint (msgid, pgm_id, string, info, color,
                  flags)
char      *msgid;
char      *pgm_id;
char      *string;
char      *info;
DCLONG    color;
DCLONG    flags;

Description

The function dc_logprint() outputs a character string specified for an argument to the message log file. Before the output, the function dc_logprint() adds the following information to the character string through OpenTP1:

OpenTP1 assigns a number from 05000 to 06999 to a message ID used in the function dc_logprint(). Assign a number from 05000 to 06999 to a message ID output from a UAP.

Even if an error occurs, DC_OK might be returned. Consequently, a message log might be missing. The missing message log can be identified by checking the message log serial numbers.

If the function dc_logprint() is called more than once from one process, the sequence of output to the message log file is ensured. However, if the function dc_logprint() is called from each of multiple processes, the message logs might not be output to the message log file in the issue sequence.

If a communication error (DCLOGER_COMM) or a log service inactive error (DCLOGER_NOT_UP) occurs, the message issued from the UAP is edited in the UAP process and is output to the standard error output file. Either of the following codes which indicate the causes of errors is added to the end of the message:

Examples
KFCA05201-I SPP1: A service request was received. (E1)
KFCA05410-I SPP1: Updating starts. (E2)

If an error other than E1 or E2 is detected, OpenTP1 assigns the message ID number specified in the function dc_logprint() to a message log indicating the error cause. Then, it provides the log to the standard error.

Arguments whose values are set in the UAP

msgid

Specify the message ID to be assigned to each message log. The message ID must be in the KFCAn1n2n3n4n5-x format (11 characters) and end with a null character. Specify a value from 05000 to 06999 for the serial number (n1n2n3n4n5) output from the UAP.

pgm_id

Specify a user-selected value (request source program ID) for identifying the UAP that called the function dc_logprint(). The value must comprise two alphanumeric characters and end with a null character.

string

Specify a character string to be output as a message log to the message log file. The character string can be specified with up to 222 characters. The character string must end with a null character.

info

Specify NULL.

color

Specify the display color of the message log specified in the function dc_logprint () when the message log is output to the NETM operation support terminal. The following colors are available:

1: Green

2: Red

3: White

4: Blue

5: Purple

6: Sky blue

7: Yellow

If a value other than the above or a null character is specified, green is assumed to be specified.

flags

Specify DCNOFLAGS.

Return values

Return value Return value (numeric) Explanation
DC_OK 0 Normal termination.
DCLOGER_PARAM_ARGS -1900 The value specified for the argument is invalid.
DCLOGER_COMM -1901 A communication error occurred or the function dc_rpc_open() was not issued.
DCLOGER_MEMORY -1902 The memory became insufficient.
DCLOGER_DEFFILE -1904 The system definition is invalid.
DCLOGER_NOT_UP -1905 The log service is not active.
DCLOGER_HEADER -1906 An error occurred when the log service acquired the information to be added to the message log.

Note

When a large log is output, return of the function dc_logprint may be delayed. For example, when the volume of output messages greatly increases due to the occurrence of an error, the transaction processing time increases. Note that this may cause a slowdown.