Logging Manager Library Module

The logging manager library module has the file name logman.c. This module manages messages and allows the messages to be dynamically sent to either a local log file (using the personal logging API) or the system logger.

This module uses the personal logging API to send messages to a local log and the system logger API to send messages to the system logger.

In order to send messages to the system logger, the application must be linked with:

   - the low level IPC API's
   - the socloc API's
   - the system logging API's

Refer to the module list below (module dependencies) for a list of each required module.

This module can be compiled with or without system logger support. The support for the system logger is controlled through the define:

   HAS_SYSLOG

In the Future Lab scripts or batch files, this define is turned on by including the environment variable HASYSLOG (using the Linux OS, as an example, this is defined in the script include.linux).

This module contains the following global data:

Here is a list of functions in the logging manager library module:

Module Dependencies

The following modules are required along with this module:

Module Header Files

This module requires the header files:

Module Functions

logman_start

Prototype  : int logman_start(char *dest, char *apname)
Parameters :
      Name : dest
Description: message destination

      Name : apname
Description: application name

Returns    : zero upon success, one (personal logging) or a sys_log code

This function will start logging through the log manager by either starting to log using a local log file or the system log interface depending on the contents of the message destination. The application name parameter is only required (always) for the system logger. If logging has been successfully started with a message destination at least once, you are allowed to pass a NULL string for the message destination which indicates to re-start the same destination. This function returns a system log code if the system log was requested or zero upon success, one upon failure when the system log was not requested.

logman_end

Prototype  : void logman_end(void)

This function will stop the log manager and all logging.

logman

Prototype  : int logman(char *fmt,...)
Parameters :
      Name : fmt
Description: message format

This function will output a message through the log manager to the current destination. The message is only output if the log manager is active (by calling the function logman_start). This function takes a variable number of arguments in the printf style.

logman_nf

Prototype  : int logman_nf(char *mes)
Parameters :
      Name : mes
Description: message text

This function will output a pre-formatted message through the log manager to the current destination. The message is only output if the log manager is active (by calling the function logman_start.

logman_is_active

Prototype  : int logman_is_active(void)

Returns    : TRUE if active, FALSE otherwise

This function return the status of the log manager.

logman_get_name

Prototype  : int logman_get_name(char *name)
Parameters :
      Name : name
Description: returned log name/destination

Returns    : TRUE upon succes, FALSE otherwise

This function will obtain and return the current log name or destination. Function returns the log name or destination in the returned log name/destination (which must already be allocated to sufficient size by the caller) along with TRUE upon success.

logman_console

Prototype  : void logman_console(int flag)
Parameters :
      Name : flag
Description: console output flag

This function will set whether logging output will be sent to the console/screen. Output will be turned off if the console output flag is zero. Any other value will cause console output to be turned on.

logman_get_console

Prototype  : int logman_get_console(void)

Returns    : TRUE if console output is on, FALSE otherwise

This function will return the current log console output flag.

logman_ipc_socloc_init

Prototype  : static int logman_ipc_socloc_init(void)

Returns    : TRUE upon success, FALSE otherwise

This private function will initialize socket communication, form a connection to a socloc server and update the socloc config list.

Goto Top | GPL Software Overview | GPL Library
Future Lab Home | Contact Webmaster | Feedback

Copyright © 2005-2006 Future Lab, Last Updated Jun 30, 2006