Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

LogTrace


Files

file  psLogMsg.h
 Procedures for logging messages.
file  psLogMsg.h
 Procedures for logging messages.
file  psTrace.h
 basic run-time trace facilities

Data Structures

struct  p_psComponent
 Basic structure for the component tree. More...

Defines

#define PS_TRACE_ON   1
 Functions.

Typedefs

typedef p_psComponent p_psComponent
 Basic structure for the component tree.

Enumerations

enum  { PS_LOG_ABORT = 0, PS_LOG_ERROR, PS_LOG_WARN, PS_LOG_INFO }
 < Status codes for log messages More...
enum  { PS_LOG_NONE, PS_LOG_TO_STDERR, PS_LOG_TO_STDOUT }

Functions

bool psLogSetDestination (int fd)
 This procedure sets the destination for future log messages.
int psLogSetLevel (int level)
 This procedure sets the message level for future log messages.
bool psLogSetFormat (const char *format)
 This procedure sets the log format for future log messages.
int psMessageDestination (const char *dest)
 This procedures uses a string to set the destination for which to send the corresponding log messages.
void psLogMsg (const char *name, int level, const char *format,...)
 This procedure logs a message to the destination set by a prior call to psLogSetDestination(), if myLevel is less than the level specified by a prior call to psLogSetLevel().
void psLogMsgV (const char *name, int level, const char *format, va_list ap)
 This procedure is functionally equivalent to psLogMsg(), except that it takes a va_list as the message parameter, not a printf-style string.
bool psTraceSetFormat (const char *format)
 This procedure sets the trace format for future trace messages.
void psTrace (const char *facil, int level, const char *format,...)
 Sends a trace message.
int psTraceSetLevel (const char *facil, int level)
 Set trace level.
int psTraceGetLevel (const char *facil)
 Get the trace level.
void psTraceReset ()
 Set all trace levels to zero (do not free nodes in the component tree).
void psTracePrintLevels (void)
 print trace levels
void psTraceSetDestination (int fd)
 Set the destination of future trace messages.
int psTraceGetDestination (void)
 Get the current destination for trace messages.


Define Documentation

#define PS_TRACE_ON   1
 

Functions.

Definition at line 46 of file psTrace.h.


Typedef Documentation

typedef struct p_psComponent p_psComponent
 

Basic structure for the component tree.

A component is a string of the form aaa.bbb.ccc, and may itself contain further subcomponents. The Component structure doesn't in fact contain it's full name, but only the last part.


Enumeration Type Documentation

anonymous enum
 

< Status codes for log messages

Enumeration values:
PS_LOG_ABORT  log message is a critical error, perform an abort after printing
PS_LOG_ERROR  log message is an error, but don't abort
PS_LOG_WARN  log message is a warning
PS_LOG_INFO  log message is informational only

Definition at line 100 of file psLogMsg.h.

anonymous enum
 

Enumeration values:
PS_LOG_NONE  turn off logging
PS_LOG_TO_STDERR  log to system's stderr
PS_LOG_TO_STDOUT  log to system's stdout

Definition at line 108 of file psLogMsg.h.


Function Documentation

void psLogMsg const char *  name,
int  level,
const char *  format,
  ...
 

This procedure logs a message to the destination set by a prior call to psLogSetDestination(), if myLevel is less than the level specified by a prior call to psLogSetLevel().

The message is specified with a printf-type string and arguments.

Parameters:
name  name of the log source
level  severity level of this log message
format  printf-style format command

void psLogMsgV const char *  name,
int  level,
const char *  format,
va_list  ap
 

This procedure is functionally equivalent to psLogMsg(), except that it takes a va_list as the message parameter, not a printf-style string.

Parameters:
name  name of the log source
level  severity level of this log message
format  printf-style format command
ap  varargs argument list

bool psLogSetDestination int  fd  ) 
 

This procedure sets the destination for future log messages.

This procedure will take a character string as an argument which can specify general log destinations.

Returns:
bool true if set successfully, otherwise false.
Parameters:
fd  Specifies where to send messages.

bool psLogSetFormat const char *  format  ) 
 

This procedure sets the log format for future log messages.

The argument must be a character string consistsing of the letters H (host), L (level), M (message), N (name), and T (time). The default is "THLNM". Deleting a letter from the string will cause the associated information to not be logged. This procedure does not alter the order in which the messages are displayed.

Returns:
bool: True if successful, otherwise false.
Parameters:
format  Specifies the system log format

int psLogSetLevel int  level  ) 
 

This procedure sets the message level for future log messages.

Subsequent log messages, with a log level of "mylevel", will only be logged if "mylevel" is less than the current log level set by this procedure. Ie. higher values set by this procedure will cause more log messages to be displayed. The old log level will be returned.

Returns:
int old logging level
Parameters:
level  Specifies the system log level

int psMessageDestination const char *  dest  ) 
 

This procedures uses a string to set the destination for which to send the corresponding log messages.

Returns:
int: The file descriptor location of the message.
Parameters:
dest  Specifies where to send the message

void psTrace const char *  facil,
int  level,
const char *  format,
  ...
 

Sends a trace message.

Parameters:
facil  facilty of interest
level  desired trace level
format  printf-style format command

int psTraceGetDestination void   ) 
 

Get the current destination for trace messages.

Returns:
FILE*: File Destination

int psTraceGetLevel const char *  facil  ) 
 

Get the trace level.

Returns:
int: Trace Level
Parameters:
facil  facilty of interest

void psTracePrintLevels void   ) 
 

print trace levels

void psTraceReset  ) 
 

Set all trace levels to zero (do not free nodes in the component tree).

void psTraceSetDestination int  fd  ) 
 

Set the destination of future trace messages.

Parameters:
fd  File descriptor

bool psTraceSetFormat const char *  format  ) 
 

This procedure sets the trace format for future trace messages.

The argument must be a character string consistsing of the letters H (host), L (level), M (message), N (name), and T (time). The default is "THLNM". Deleting a letter from the string will cause the associated information to not be logged. This procedure does not alter the order in which the messages are displayed.

Returns:
bool: True if successful, otherwise false.
Parameters:
format  Specifies the system trace format

int psTraceSetLevel const char *  facil,
int  level
 

Set trace level.

Returns:
int: The previous level.
Parameters:
facil  facilty of interest
level  desired trace level


Generated on Wed Sep 14 10:43:47 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2