libyui  3.0.10
 All Classes Functions Variables Enumerations Friends
YUILog Class Reference

#include <YUILog.h>

Public Member Functions

std::ostream & log (YUILogLevel_t logLevel, const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
 

Static Public Member Functions

static std::ostream & debug (const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
 
static std::ostream & milestone (const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
 
static std::ostream & warning (const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
 
static std::ostream & error (const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
 
static YUILoginstance ()
 
static void enableDebugLogging (bool debugLogging=true)
 
static bool debugLoggingEnabled ()
 
static bool setLogFileName (const std::string &logFileName)
 
static std::string logFileName ()
 
static void setLoggerFunction (YUILoggerFunction loggerFunction)
 
static YUILoggerFunction loggerFunction (bool returnStdLogger=false)
 
static void setEnableDebugLoggingHooks (YUIEnableDebugLoggingFunction enableFunction, YUIDebugLoggingEnabledFunction isEnabledFunction)
 
static
YUIEnableDebugLoggingFunction 
enableDebugLoggingHook ()
 
static
YUIDebugLoggingEnabledFunction 
debugLoggingEnabledHook ()
 
static std::string basename (const std::string &fileNameWithPath)
 

Detailed Description

UI logging.

Definition at line 97 of file YUILog.h.

Member Function Documentation

std::string YUILog::basename ( const std::string &  fileNameWithPath)
static

Return the base name without path from a file name with path.

Definition at line 512 of file YUILog.cc.

std::ostream & YUILog::debug ( const char *  logComponent,
const char *  sourceFileName,
int  lineNo,
const char *  functionName 
)
static

Logging functions for each log level. They all access the singleton object for this class. This means that the first call to any of those functions will create the singleton YUILog object.

Definition at line 483 of file YUILog.cc.

Here is the call graph for this function:

bool YUILog::debugLoggingEnabled ( )
static

Return 'true' if debug logging is enabled, 'false' if not.

Definition at line 397 of file YUILog.cc.

Here is the call graph for this function:

YUIDebugLoggingEnabledFunction YUILog::debugLoggingEnabledHook ( )
static

Return the hook function that checks if debug logging is enabled or 0 if no such hook function is set.

Definition at line 445 of file YUILog.cc.

Here is the call graph for this function:

void YUILog::enableDebugLogging ( bool  debugLogging = true)
static

Enable or disable debug logging.

Definition at line 387 of file YUILog.cc.

Here is the call graph for this function:

YUIEnableDebugLoggingFunction YUILog::enableDebugLoggingHook ( )
static

Return the hook function that enables or disables debug logging or 0 if no such hook function is set.

Definition at line 438 of file YUILog.cc.

Here is the call graph for this function:

YUILog * YUILog::instance ( )
static

Return the singleton object for this class. This will create the singleton if it doesn't exist yet.

Definition at line 329 of file YUILog.cc.

std::ostream & YUILog::log ( YUILogLevel_t  logLevel,
const char *  logComponent,
const char *  sourceFileName,
int  lineNo,
const char *  functionName 
)

Generic log function. debug(), milestone() etc. ultimately all call this function.

Definition at line 452 of file YUILog.cc.

Here is the call graph for this function:

std::string YUILog::logFileName ( )
static

Return the current log file name or an empty string if stderr is used. Notice that this information is only relevant as long as the standard logger function is used.

Definition at line 380 of file YUILog.cc.

Here is the call graph for this function:

YUILoggerFunction YUILog::loggerFunction ( bool  returnStdLogger = false)
static

Return the UI logger function.

If stderr is used for logging (i.e. no logger function set), 0 is returned (unless 'returnStdLogger' is 'true', in which case the internally used stderr-logger is returned).

Definition at line 417 of file YUILog.cc.

Here is the call graph for this function:

void YUILog::setEnableDebugLoggingHooks ( YUIEnableDebugLoggingFunction  enableFunction,
YUIDebugLoggingEnabledFunction  isEnabledFunction 
)
static

Set the hook functions to enable/disable debug logging and to query if debug logging is enabled:

void enableDebugLogging( bool enable );
bool debugLoggingEnabled();

If those functions are set, they will be used instead of the internal "debugLogging" flag.

Definition at line 429 of file YUILog.cc.

Here is the call graph for this function:

bool YUILog::setLogFileName ( const std::string &  logFileName)
static

Set the log file name to be used with the standard logger function. Output will be appended to this file.

Until this file name is set, the standard logger function logs to stderr. Set the log file name to an empty string to log to stderr again.

This returns 'true' upon success (opening the file was successful), 'false' upon error.

Notice:

(1) This file name is only relevant as long as the standard logger function is used. Custom logger functions may or may not use this file name.

(2) No attempt is made to do anything fancy with the log file like log file rotation when a certain file size is reached. Applications that need this should use a custom logger function. See also setLoggerFunction().

Definition at line 344 of file YUILog.cc.

Here is the call graph for this function:

void YUILog::setLoggerFunction ( YUILoggerFunction  loggerFunction)
static

Set the UI logger function. This is the function that will ultimately receive all UI log output (except debug logging if debug logging is disabled).

By default, all logging is output to stderr. This behaviour can be restored if 0 is passed as a function pointer here.

Definition at line 407 of file YUILog.cc.

Here is the call graph for this function:


The documentation for this class was generated from the following files: