Log4g Reference Manual | ||||
---|---|---|---|---|
Top | Description |
Log4gLoggerRepository; Log4gLoggerRepositoryInterface; Log4gLogger * log4g_logger_repository_exists (Log4gLoggerRepository *self
,const gchar *name
); void log4g_logger_repository_emit_add_appender_signal (Log4gLoggerRepository *self
,Log4gLogger *logger
,Log4gAppender *appender
); void log4g_logger_repository_emit_remove_appender_signal (Log4gLoggerRepository *self
,Log4gLogger *logger
,Log4gAppender *appender
); const GArray * log4g_logger_repository_get_current_loggers (Log4gLoggerRepository *self
); Log4gLogger * log4g_logger_repository_get_logger (Log4gLoggerRepository *self
,const gchar *name
); Log4gLogger * log4g_logger_repository_get_logger_factory (Log4gLoggerRepository *self
,const gchar *name
,Log4gLoggerFactory *factory
); Log4gLogger * log4g_logger_repository_get_root_logger (Log4gLoggerRepository *self
); Log4gLevel * log4g_logger_repository_get_threshold (Log4gLoggerRepository *self
); gboolean log4g_logger_repository_is_disabled (Log4gLoggerRepository *self
,gint level
); void log4g_logger_repository_reset_configuration (Log4gLoggerRepository *self
); void log4g_logger_repository_set_threshold (Log4gLoggerRepository *self
,Log4gLevel *level
); void log4g_logger_repository_set_threshold_string (Log4gLoggerRepository *self
,const gchar *string
); void log4g_logger_repository_shutdown (Log4gLoggerRepository *self
); void log4g_logger_repository_emit_no_appender_warning (Log4gLoggerRepository *self
,Log4gLogger *logger
); Log4gLogger (*Log4gLoggerRepositoryExists) (Log4gLoggerRepository *self
,const gchar *name
); const GArray (*Log4gLoggerRepositoryGetCurrentLoggers) (Log4gLoggerRepository *self
); Log4gLogger (*Log4gLoggerRepositoryGetLogger) (Log4gLoggerRepository *self
,const gchar *name
); Log4gLogger (*Log4gLoggerRepositoryGetLoggerFactory) (Log4gLoggerRepository *self
,const gchar *name
,Log4gLoggerFactory *factory
); Log4gLogger (*Log4gLoggerRepositoryGetRootLogger) (Log4gLoggerRepository *self
); Log4gLevel (*Log4gLoggerRepositoryGetThreshold) (Log4gLoggerRepository *self
); gboolean (*Log4gLoggerRepositoryIsDisabled) (Log4gLoggerRepository *self
,gint level
); void (*Log4gLoggerRepositoryResetConfiguration) (Log4gLoggerRepository *self
); void (*Log4gLoggerRepositorySetThreshold) (Log4gLoggerRepository *self
,Log4gLevel *level
); void (*Log4gLoggerRepositorySetThresholdString) (Log4gLoggerRepository *self
,const gchar *level
); void (*Log4gLoggerRepositoryShutdown) (Log4gLoggerRepository *self
); void (*Log4gLoggerRepositoryEmitNoAppenderWarning) (Log4gLoggerRepository *self
,Log4gLogger *logger
);
A logger repository is used to create and retrieve loggers. The relationship between loggers and the repository depends on the repository implementation but usually loggers are arranged in a named hierarchy.
In addition to the create functions, a logger repository can be queried for existing loggers and act as a registry for events related to loggers.
Logger repositories have the following signals:
add-appender
remove-appender
The add-appender signal is invoked whenever an appender is added to a logger in the repository.
The type signature for the add-appender signal is:
typedef void (*add_appender)(Log4gLogger *logger, Log4gAppender *appender);
The remove-appender signal is invoked whenever an appender is removed from a logger in the repository.
The type signature for the remove-appender signal is:
typedef void (*remove_appender)(Log4gLogger *logger, Log4gAppender *appender);
typedef struct { Log4gLoggerRepositoryExists exists; Log4gLoggerRepositoryGetCurrentLoggers get_current_loggers; Log4gLoggerRepositoryGetLogger get_logger; Log4gLoggerRepositoryGetLoggerFactory get_logger_factory; Log4gLoggerRepositoryGetRootLogger get_root_logger; Log4gLoggerRepositoryGetThreshold get_threshold; Log4gLoggerRepositoryIsDisabled is_disabled; Log4gLoggerRepositoryResetConfiguration reset_configuration; Log4gLoggerRepositorySetThreshold set_threshold; Log4gLoggerRepositorySetThresholdString set_threshold_string; Log4gLoggerRepositoryShutdown shutdown; Log4gLoggerRepositoryEmitNoAppenderWarning emit_no_appender_warning; } Log4gLoggerRepositoryInterface;
Log4gLoggerRepositoryExists |
Determine if a given logger exists in the repository. |
Log4gLoggerRepositoryGetCurrentLoggers |
Get all loggers in the repository. |
Log4gLoggerRepositoryGetLogger |
Get an existing logger or create a new one. |
Log4gLoggerRepositoryGetLoggerFactory |
Get an existing logger or create it with a factory. |
Log4gLoggerRepositoryGetRootLogger |
Get the root logger. |
Log4gLoggerRepositoryGetThreshold |
Get the repository threshold. |
Log4gLoggerRepositoryIsDisabled |
Determine if the repository is disabled at a given level. |
Log4gLoggerRepositoryResetConfiguration |
Reset the repository configuration. |
Log4gLoggerRepositorySetThreshold |
Set the repository threshold. |
Log4gLoggerRepositorySetThresholdString |
Set the repository threshold by string value. |
Log4gLoggerRepositoryShutdown |
Shut down the logger repository. |
Log4gLoggerRepositoryEmitNoAppenderWarning |
Emit a warning if no appenders are attached. |
Log4gLogger * log4g_logger_repository_exists (Log4gLoggerRepository *self
,const gchar *name
);
Call the exists
function from the Log4gLoggerRepositoryInterface of self
.
|
A logger repository object. |
|
The name of the logger to check. |
Returns : |
The logger named name or NULL if it does not exist.
|
Since 0.1
void log4g_logger_repository_emit_add_appender_signal (Log4gLoggerRepository *self
,Log4gLogger *logger
,Log4gAppender *appender
);
Emit the the add-appender signal of self
.
|
A logger repository object. |
|
The logger from to appender was added.
|
|
The appender that was added. |
Since 0.1
void log4g_logger_repository_emit_remove_appender_signal (Log4gLoggerRepository *self
,Log4gLogger *logger
,Log4gAppender *appender
);
Emit the remove-appender signal of self
.
|
A logger repository object. |
|
The logger from which appender was removed.
|
|
The appender that was removed. |
Since 0.1
const GArray * log4g_logger_repository_get_current_loggers
(Log4gLoggerRepository *self
);
Call the get_current_loggers
function from the
Log4gLoggerRepositoryInterface of self
.
|
A logger repository object. |
Returns : |
An array containing all loggers in the repository or NULL
if there are none.
|
Since 0.1
Log4gLogger * log4g_logger_repository_get_logger (Log4gLoggerRepository *self
,const gchar *name
);
Call the get_logger
function from the Log4gLoggerRepositoryInterface
of self
.
|
A logger repository object. |
|
The name of the logger to retrieve. |
Returns : |
The logger named name .
|
Since 0.1
Log4gLogger * log4g_logger_repository_get_logger_factory (Log4gLoggerRepository *self
,const gchar *name
,Log4gLoggerFactory *factory
);
Call the get_logger_factory
function from the
Log4gLoggerRepositoryInterface of self
.
|
A logger repository object. |
|
The name of the logger to retrieve. |
|
The factory to use. |
Returns : |
The logger named name .
|
Since 0.1
Log4gLogger * log4g_logger_repository_get_root_logger
(Log4gLoggerRepository *self
);
Call the get_root_logger
function from the Log4gLoggerRepositoryInterface
of self
.
|
A logger repository object. |
Returns : |
The root logger. |
Since 0.1
Log4gLevel * log4g_logger_repository_get_threshold
(Log4gLoggerRepository *self
);
Call the get_threshold
function from the Log4gLoggerRepositoryInterface
of self
.
See
: Log4gLevelClass
|
A logger repository object. |
Returns : |
The threshold level for self .
|
Since 0.1
gboolean log4g_logger_repository_is_disabled (Log4gLoggerRepository *self
,gint level
);
Call the is_disabled
function from the Log4gLoggerRepositoryInterface
of self
.
See
: Log4gLevelClass
|
A logger repository object. |
|
The integer representation of a log level. |
Returns : |
TRUE if self is disabled for level , FALSE otherwise.
|
Since 0.1
void log4g_logger_repository_reset_configuration
(Log4gLoggerRepository *self
);
Call the reset_configuration
function from the
Log4gLoggerRepositoryInterface of self
.
|
A logger repository object. |
Since 0.1
void log4g_logger_repository_set_threshold (Log4gLoggerRepository *self
,Log4gLevel *level
);
Call the set_threshold
function from the Log4gLoggerRepositoryInterface
of self
.
See
: Log4gLevelClass
|
A logger repository object. |
|
The new threshold for self .
|
Since 0.1
void log4g_logger_repository_set_threshold_string (Log4gLoggerRepository *self
,const gchar *string
);
Call the set_threshold_string
function from the
Log4gLoggerRepositoryInterface of self
.
|
A logger repository object. |
|
The name of the new threshold to set. |
Since 0.1
void log4g_logger_repository_shutdown (Log4gLoggerRepository *self
);
Call the shutdown
function from the Log4gLoggerRepositoryInterface
of self
.
|
A logger repository object. |
Since 0.1
void log4g_logger_repository_emit_no_appender_warning (Log4gLoggerRepository *self
,Log4gLogger *logger
);
Call the emit_no_appender_warning
function from the
Log4gLoggerRepositoryInterface of self
.
|
A logger repository object. |
|
The logger that produced the warning. |
Since 0.1
Log4gLogger (*Log4gLoggerRepositoryExists) (Log4gLoggerRepository *self
,const gchar *name
);
Determine if a named logger exists.
If the named logger does not exist it is not created.
|
A logger repository object. |
|
The name of the logger to check. |
Returns : |
The logger named name or NULL if it does not exist.
|
Since 0.1
const GArray (*Log4gLoggerRepositoryGetCurrentLoggers)
(Log4gLoggerRepository *self
);
Retrieve all loggers in the repository.
It is the responsibility of the caller to call g_array_free()
for the
returned value.
|
A logger repository object. |
Returns : |
An array containing all loggers in the repository or NULL if
there are none.
|
Since 0.1
Log4gLogger (*Log4gLoggerRepositoryGetLogger) (Log4gLoggerRepository *self
,const gchar *name
);
Retrieve a named logger from the repository.
If the logger named name
does not already exist it should be
created and added to the repository.
|
A logger repository object. |
|
The name of the logger to retrieve. |
Returns : |
The logger named name .
|
Since 0.1
Log4gLogger (*Log4gLoggerRepositoryGetLoggerFactory) (Log4gLoggerRepository *self
,const gchar *name
,Log4gLoggerFactory *factory
);
Retrieve a named logger from the repository.
If the logger named name
does not already exist it should be
created using factory
and added to the repository.
|
A logger repository object. |
|
The name of the logger to retrieve. |
|
The factory to use. |
Returns : |
The logger named name .
|
Since 0.1
Log4gLogger (*Log4gLoggerRepositoryGetRootLogger)
(Log4gLoggerRepository *self
);
Retrieve the root logger.
|
A logger repository object. |
Returns : |
The root logger. |
Since 0.1
Log4gLevel (*Log4gLoggerRepositoryGetThreshold)
(Log4gLoggerRepository *self
);
Retrieve the repository threshold.
See
: Log4gLevelClass, Log4gLoggerRepositoryInterface.set_threshold
|
A logger repository object. |
Returns : |
The threshold level for self .
|
Since 0.1
gboolean (*Log4gLoggerRepositoryIsDisabled) (Log4gLoggerRepository *self
,gint level
);
Determine if the repository is disabled for a given log level.
\see Log4gLevelClass, Log4gLoggerRepositoryInterface.set_threshold
|
A logger repository object. |
|
The integer representation of a log level. |
Returns : |
TRUE if self is disabled for level , FALSE otherwise.
|
Since 0.1
void (*Log4gLoggerRepositoryResetConfiguration)
(Log4gLoggerRepository *self
);
Reset a repository to its initial state.
|
A logger repository object. |
Since 0.1
void (*Log4gLoggerRepositorySetThreshold) (Log4gLoggerRepository *self
,Log4gLevel *level
);
Set the repository threshold.
All logging requests below the threshold are immediately dropped.
By default the threshold is set to ALL
, which has the lowest
possible rank.
See
: Log4gLevelClass
|
A logger repository object. |
|
The new threshold for self .
|
Since 0.1
void (*Log4gLoggerRepositorySetThresholdString) (Log4gLoggerRepository *self
,const gchar *level
);
Set the repository threshold from a string.
See
: Log4gLevelClass
|
A logger repository object. |
|
The new threshold level name to set. |
Since 0.1
void (*Log4gLoggerRepositoryShutdown) (Log4gLoggerRepository *self
);
Shutdown the repository.
Once the repository is shut down it cannot be used by the Log4g system.
|
A logger repository object. |
Since 0.1
void (*Log4gLoggerRepositoryEmitNoAppenderWarning) (Log4gLoggerRepository *self
,Log4gLogger *logger
);