27 #ifndef YUILogComponent
28 #error Missing #define YUILogComponent "myComponent" before #include "YUILog.h"
57 #define yuiDebug() YUILog::debug ( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ )
58 #define yuiMilestone() YUILog::milestone( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ )
59 #define yuiWarning() YUILog::warning ( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ )
60 #define yuiError() YUILog::error ( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ )
85 typedef void (*YUILoggerFunction)( YUILogLevel_t,
92 typedef void (*YUIEnableDebugLoggingFunction)( bool );
93 typedef bool (*YUIDebugLoggingEnabledFunction)();
107 static std::ostream &
debug (
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
108 static std::ostream & milestone(
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
109 static std::ostream & warning (
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
110 static std::ostream & error (
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
115 std::ostream &
log( YUILogLevel_t logLevel,
116 const char * logComponent,
117 const char * sourceFileName,
119 const char * functionName );
185 static YUILoggerFunction
loggerFunction(
bool returnStdLogger =
false );
198 YUIDebugLoggingEnabledFunction isEnabledFunction );
215 static std::string
basename(
const std::string & fileNameWithPath );
static bool debugLoggingEnabled()
Return 'true' if debug logging is enabled, 'false' if not.
static std::string basename(const std::string &fileNameWithPath)
Return the base name without path from a file name with path.
static void setEnableDebugLoggingHooks(YUIEnableDebugLoggingFunction enableFunction, YUIDebugLoggingEnabledFunction isEnabledFunction)
Set the hook functions to enable/disable debug logging and to query if debug logging is enabled:
static std::string logFileName()
Return the current log file name or an empty string if stderr is used.
static bool setLogFileName(const std::string &logFileName)
Set the log file name to be used with the standard logger function.
std::ostream & log(YUILogLevel_t logLevel, const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
Generic log function.
static YUILoggerFunction loggerFunction(bool returnStdLogger=false)
Return the UI logger function.
static YUIDebugLoggingEnabledFunction debugLoggingEnabledHook()
Return the hook function that checks if debug logging is enabled or 0 if no such hook function is set...
static void enableDebugLogging(bool debugLogging=true)
Enable or disable debug logging.
static std::ostream & debug(const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
Logging functions for each log level.
static YUILog * instance()
Return the singleton object for this class.
static YUIEnableDebugLoggingFunction enableDebugLoggingHook()
Return the hook function that enables or disables debug logging or 0 if no such hook function is set.
static void setLoggerFunction(YUILoggerFunction loggerFunction)
Set the UI logger function.