27 #ifndef YUILogComponent 28 #error Missing #define YUILogComponent "myComponent" before #include "YUILog.h" 55 #define yuiDebug() YUILog::debug ( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ ) 56 #define yuiMilestone() YUILog::milestone( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ ) 57 #define yuiWarning() YUILog::warning ( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ ) 58 #define yuiError() YUILog::error ( YUILogComponent, __FILE__, __LINE__, __FUNCTION__ ) 83 typedef void (*YUILoggerFunction)( YUILogLevel_t,
90 typedef void (*YUIEnableDebugLoggingFunction)( bool );
91 typedef bool (*YUIDebugLoggingEnabledFunction)();
105 static std::ostream &
debug (
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
106 static std::ostream & milestone(
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
107 static std::ostream & warning (
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
108 static std::ostream & error (
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
113 std::ostream &
log( YUILogLevel_t logLevel,
114 const char * logComponent,
115 const char * sourceFileName,
117 const char * functionName );
183 static YUILoggerFunction
loggerFunction(
bool returnStdLogger =
false );
196 YUIDebugLoggingEnabledFunction isEnabledFunction );
213 static std::string
basename(
const std::string & fileNameWithPath );
static void setLoggerFunction(YUILoggerFunction loggerFunction)
Set the UI logger function.
std::ostream & log(YUILogLevel_t logLevel, const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
Generic log function.
static std::ostream & debug(const char *logComponent, const char *sourceFileName, int lineNo, const char *functionName)
Logging functions for each log level.
static std::string basename(const std::string &fileNameWithPath)
Return the base name without path from a file name with path.
static bool setLogFileName(const std::string &logFileName)
Set the log file name to be used with the standard logger function.
static std::string logFileName()
Return the current log file name or an empty string if stderr is used.
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 setEnableDebugLoggingHooks(YUIEnableDebugLoggingFunction enableFunction, YUIDebugLoggingEnabledFunction isEnabledFunction)
Set the hook functions to enable/disable debug logging and to query if debug logging is enabled: ...
static YUIEnableDebugLoggingFunction enableDebugLoggingHook()
Return the hook function that enables or disables debug logging or 0 if no such hook function is set...
static YUILog * instance()
Return the singleton object for this class.
static bool debugLoggingEnabled()
Return 'true' if debug logging is enabled, 'false' if not.
static void enableDebugLogging(bool debugLogging=true)
Enable or disable debug logging.
static YUILoggerFunction loggerFunction(bool returnStdLogger=false)
Return the UI logger function.