Log4gLevel

Log4gLevel — Minimum set of logging levels recognized by the system

Synopsis

                    Log4gLevel;
                    Log4gLevelClass;
enum                Log4gLevelInt;
Log4gLevel *        log4g_level_new                     (gint level,
                                                         const gchar *string,
                                                         gint syslog);
gboolean            log4g_level_equals                  (Log4gLevel *self,
                                                         Log4gLevel *level);
gint                log4g_level_get_syslog_equivalent   (Log4gLevel *self);
gboolean            log4g_level_is_greater_or_equal     (Log4gLevel *self,
                                                         Log4gLevel *level);
const gchar *       log4g_level_to_string               (Log4gLevel *self);
gint                log4g_level_to_int                  (Log4gLevel *self);
Log4gLevel *        log4g_level_string_to_level         (const gchar *string);
Log4gLevel *        log4g_level_string_to_level_default (const gchar *string,
                                                         Log4gLevel *def);
Log4gLevel *        log4g_level_int_to_level            (gint level);
Log4gLevel *        log4g_level_int_to_level_default    (gint level,
                                                         Log4gLevel *def);
Log4gLevel *        log4g_level_ALL                     (void);
Log4gLevel *        log4g_level_TRACE                   (void);
Log4gLevel *        log4g_level_DEBUG                   (void);
Log4gLevel *        log4g_level_INFO                    (void);
Log4gLevel *        log4g_level_WARN                    (void);
Log4gLevel *        log4g_level_ERROR                   (void);
Log4gLevel *        log4g_level_FATAL                   (void);
Log4gLevel *        log4g_level_OFF                     (void);
Log4gLevel          (*Log4gLevelStringToLevel)          (const gchar *level);
Log4gLevel          (*Log4gLevelStringToLevelDefault)   (const gchar *level,
                                                         Log4gLevel *def);
Log4gLevel          (*Log4gLevelIntToLevel)             (gint level);
Log4gLevel          (*Log4gLevelIntToLevelDefault)      (gint level,
                                                         Log4gLevel *def);

Description

The following base log levels are defined:

  • OFF

  • FATAL

  • ERROR

  • WARN

  • INFO

  • DEBUG

  • ALL

The Log4gLevel class may be sub-classed to define a larger level set.

Details

Log4gLevel

typedef struct {
} Log4gLevel;

The Log4gLevel structure does not have any public members.


Log4gLevelClass

typedef struct {
    Log4gLevelStringToLevel string_to_level;
    Log4gLevelStringToLevelDefault string_to_level_default;
    Log4gLevelIntToLevel int_to_level;
    Log4gLevelIntToLevelDefault int_to_level_default;
    Log4gLevel *ALL;
    Log4gLevel *TRACE;
    Log4gLevel *DEBUG;
    Log4gLevel *INFO;
    Log4gLevel *WARN;
    Log4gLevel *ERROR;
    Log4gLevel *FATAL;
    Log4gLevel *OFF;
} Log4gLevelClass;

Log4gLevelStringToLevel string_to_level;

Convert a string passed as an argument to a level.

Log4gLevelStringToLevelDefault string_to_level_default;

Convert a string passed as an argument to a level.

Log4gLevelIntToLevel int_to_level;

Convert an integer passed as an argument to a level.

Log4gLevelIntToLevelDefault int_to_level_default;

Convert an integer passed as an argument to a level.

Log4gLevel *ALL;

Has the lowest possible rank and is intended to turn on all logging.

Log4gLevel *TRACE;

Indicates finer-grained information than Log4gLevelClass.DEBUG.

Log4gLevel *DEBUG;

Indicates fine-grained events that are useful for debugging.

Log4gLevel *INFO;

Indicates messages that highlight the progress of the application at a coarse-grained level.

Log4gLevel *WARN;

Indicates potentially harmful situations.

Log4gLevel *ERROR;

Indicates an error event that may allow the application to continue.

Log4gLevel *FATAL;

Indicates a very severe error that will presumably lead the application to abort.

Log4gLevel *OFF;

Has the highest possible rank and is intended to turn off logging.

enum Log4gLevelInt

typedef enum {
    LOG4G_LEVEL_ALL_INT = G_MININT,
    LOG4G_LEVEL_TRACE_INT = 5000,
    LOG4G_LEVEL_DEBUG_INT = 10000,
    LOG4G_LEVEL_INFO_INT = 20000,
    LOG4G_LEVEL_WARN_INT = 30000,
    LOG4G_LEVEL_ERROR_INT = 40000,
    LOG4G_LEVEL_FATAL_INT = 50000,
    LOG4G_LEVEL_OFF_INT = G_MAXINT
} Log4gLevelInt;

LOG4G_LEVEL_ALL_INT

ALL level integer value

LOG4G_LEVEL_TRACE_INT

TRACE level integer value

LOG4G_LEVEL_DEBUG_INT

DEBUG level integer value

LOG4G_LEVEL_INFO_INT

INFO level integer value

LOG4G_LEVEL_WARN_INT

WARN level integer value

LOG4G_LEVEL_ERROR_INT

ERROR level integer value

LOG4G_LEVEL_FATAL_INT

FATAL level integer value

LOG4G_LEVEL_OFF_INT

OFF level integer value

log4g_level_new ()

Log4gLevel *        log4g_level_new                     (gint level,
                                                         const gchar *string,
                                                         gint syslog);

Create a Log4gLevel object.

level :

The log priority.

string :

The string representation of this level.

syslog :

The syslog equivalent of this level.

Returns :

A new Log4gLevel object.

Since 0.1


log4g_level_equals ()

gboolean            log4g_level_equals                  (Log4gLevel *self,
                                                         Log4gLevel *level);

Determine if two log levels are equal.

self :

A level object.

level :

A level to compare with self.

Returns :

TRUE if self & level are equal, FALSE otherwise.

Since 0.1


log4g_level_get_syslog_equivalent ()

gint                log4g_level_get_syslog_equivalent   (Log4gLevel *self);

Retrieve the syslog(3) equivalent integer of level object.

self :

A level object.

Returns :

The syslog equivalent integer of self.

Since 0.1


log4g_level_is_greater_or_equal ()

gboolean            log4g_level_is_greater_or_equal     (Log4gLevel *self,
                                                         Log4gLevel *level);

Determine if a level is greater or equal than another level.

self :

A level object.

level :

A level object to compare with self.

Returns :

TRUE if level is greater than or equal to self, or FALSE if self is greater than level.

Since 0.1


log4g_level_to_string ()

const gchar *       log4g_level_to_string               (Log4gLevel *self);

Retrieve the string representation of a level.

self :

A level object.

Returns :

The string representation of self.

log4g_level_to_int ()

gint                log4g_level_to_int                  (Log4gLevel *self);

Retrieve the integer representation of a level.

self :

A level object.

Returns :

The integer representation of self.

Since 0.1


log4g_level_string_to_level ()

Log4gLevel *        log4g_level_string_to_level         (const gchar *string);

Calls the string_to_level function from the Log4gLevelClass of self.

string :

A string representation of a level.

Returns :

The level represented by string.

Since 0.1


log4g_level_string_to_level_default ()

Log4gLevel *        log4g_level_string_to_level_default (const gchar *string,
                                                         Log4gLevel *def);

Calls the string_to_level_default function of the Log4gLevelClass of self.

string :

A string representation of a level.

def :

The level to return if the conversion failed.

Returns :

The level represented by string or def if the conversion failed.

Since 0.1


log4g_level_int_to_level ()

Log4gLevel *        log4g_level_int_to_level            (gint level);

Calls the int_to_level function from the Log4gLevelClass of self.

level :

An integer representation of a level.

Returns :

The level represented by level.

Since 0.1


log4g_level_int_to_level_default ()

Log4gLevel *        log4g_level_int_to_level_default    (gint level,
                                                         Log4gLevel *def);

Calls the int_to_level_default from the Log4gLevelClass of self.

level :

An integer representation of a level.

def :

The level to return if the conversion failed.

Returns :

The level represented by level or def if the conversion failed.

Since 0.1


log4g_level_ALL ()

Log4gLevel *        log4g_level_ALL                     (void);

Retrieve the log level Log4gLevelClass.ALL.

Returns :

The log level Log4gLevelClass.ALL.

Since 0.1


log4g_level_TRACE ()

Log4gLevel *        log4g_level_TRACE                   (void);

Retrieve the log level Log4gLevelClass.TRACE.

Returns :

The log level Log4gLevelClass.TRACE.

Since 0.1


log4g_level_DEBUG ()

Log4gLevel *        log4g_level_DEBUG                   (void);

Retrieve the log level Log4gLevelClass.DEBUG.

Returns :

The log level Log4gLevelClass.DEBUG.

Since 0.1


log4g_level_INFO ()

Log4gLevel *        log4g_level_INFO                    (void);

Retrieve the log level Log4gLevelClass.INFO.

Returns :

The log level Log4gLevelClass.INFO.

Since 0.1


log4g_level_WARN ()

Log4gLevel *        log4g_level_WARN                    (void);

Retrieve the log level Log4gLevelClass.WARN.

Returns :

The log level Log4gLevelClass.WARN.

Since 0.1


log4g_level_ERROR ()

Log4gLevel *        log4g_level_ERROR                   (void);

Retrieve the log level Log4gLevelClass.ERROR.

Returns :

The log level Log4gLevelClass.ERROR.

Since 0.1


log4g_level_FATAL ()

Log4gLevel *        log4g_level_FATAL                   (void);

Retrieve the log level Log4gLevelClass.FATAL.

Returns :

The log level Log4gLevelClass.FATAL.

Since 0.1


log4g_level_OFF ()

Log4gLevel *        log4g_level_OFF                     (void);

Retrieve the log level Log4gLevelClass.OFF.

Returns :

The log level Log4gLevelClass.OFF.

Since 0.1


Log4gLevelStringToLevel ()

Log4gLevel          (*Log4gLevelStringToLevel)          (const gchar *level);

Convert a string passed as an argument to a level.

level :

A string representation of a level.

Returns :

The level represented by string or DEBUG if the conversion failed.

Since 0.1


Log4gLevelStringToLevelDefault ()

Log4gLevel          (*Log4gLevelStringToLevelDefault)   (const gchar *level,
                                                         Log4gLevel *def);

Convert a string passed as an argument to a level.

level :

A string representation of a level.

def :

The level to return if the conversion fails.

Returns :

The level represented by string or def if the conversion failed.

Since 0.1


Log4gLevelIntToLevel ()

Log4gLevel          (*Log4gLevelIntToLevel)             (gint level);

Convert an integer passed as an argument to a level.

level :

An integer representation of a level.

Returns :

The level represented by level or DEBUG if the conversion failed.

Since 0.1


Log4gLevelIntToLevelDefault ()

Log4gLevel          (*Log4gLevelIntToLevelDefault)      (gint level,
                                                         Log4gLevel *def);

Convert an integer passed as an argument to a level.

level :

An integer representation of a level.

def :

The level to return if the conversion fails.

Returns :

The level represented by level or def if the conversion failed.

Since 0.1