class Log

Log is an interface that sysadm services use to log various levels of messages. More...

Definition#include <sysadm/Log.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods


Detailed Description

Log is an interface that sysadm services use to log various levels of messages. The destination of log messages is controlled by sysadmd command line options (in /etc/inetd.conf), and log messages are also available to clients via the "log" service.

Messages logged via Log do not go to syslog unless specified on the sysadmd command line in /etc/inetd.conf.

Log notifies its list of LogListeners whenever a message is logged. The LogListeners output the messages to files, syslog, or whatever is appropriate.

Each log message consists of a "module" string that represents the service the message is coming from (e.g. sysadmd), a "level" (which is implicit in the static logging methods), and a printf-style format string and varargs.

enum Level {TRACE = 0x01, DEBUG = 0x02, INFO = 0x04, WARNING = 0x08, ERROR = 0x10, FATAL = 0x20, ALL = TRACE | DEBUG | INFO | WARNING | ERROR | FATAL, }

Each message that's logged has a level associated with it. Messages can be filtered based on their levels.

These values correspond to values in the java version of this class, so don't change them arbitrarily.

enum {MAXLEN = 4096 }

MAXLEN is the longest a message can be.

void  trace (const char* module, const char* format, ...)

[static]

These static methods are used by sysadmd code and associated services for logging.

void  debug (const char* module, const char* format, ...)

[static]

void  info (const char* module, const char* format, ...)

[static]

void  warning (const char* module, const char* format, ...)

[static]

void  error (const char* module, const char* format, ...)

[static]

void  fatal (const char* module, const char* format, ...)

[static]

const char*  levelToString (Level level)

[static]

Convenience method for turning "level" into a localized string.

Log&  getLog ()

[static]

Get access to an instance of Log, for calling one of the non-static methods.

void  message (const char* module, Level level, const char* format, va_list args)

Log a message. The static logging methods all end up calling this eventually.

void  adoptLogListener (LogListener* listener)

Add a listener to be notified of messages.

LogListener*  orphanLogListener (LogListener* listener)

Remove a listener from the the list of listeners that get notified when a message arrives.

void  removeLogListener (LogListener* listener)

Remove and delete a listener from the list of listeners that get notified when a message arrives.


Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36.