1 #ifndef SZA_UTIL_LOGGER_H
2 #define SZA_UTIL_LOGGER_H
14 #define LOG_HANDLER_FN(fn) void (fn)(std::string logStr)
35 static void log(std::string message,
bool isError);
36 static void log(LogStream* ls);
40 static void dispatch(std::string message,
bool isError);
41 static void dispatch(LogStream* ls);
46 static void report(std::string message,
bool isError);
47 static void report(LogStream* ls);
52 static void installLogHandler(LOG_HANDLER_FN(*logHandler));
57 static void installErrHandler(LOG_HANDLER_FN(*errHandler));
62 static void setPrefix(std::string prefix);
67 static void setLogFilePrefix(
const std::string& prefix);
72 static void setLogFileDirectory(
const std::string& dir);
77 static void openLogFile();
82 static void closeLogFile();
87 static void installStdoutPrintFn(LOG_HANDLER_FN(*stdoutPrintFn));
88 static void installStderrPrintFn(LOG_HANDLER_FN(*stderrPrintFn));
90 static void defaultStdoutPrintFn(std::string str);
91 static void defaultStderrPrintFn(std::string str);
93 static void printToStdout(std::string message);
94 static void printToStderr(std::string message);
103 static LOG_HANDLER_FN(*logHandler_);
104 static LOG_HANDLER_FN(*errHandler_);
106 static LOG_HANDLER_FN(*stdoutPrintFn_);
107 static LOG_HANDLER_FN(*stderrPrintFn_);
109 static std::string prefix_;
111 static bool haveLogFile_;
112 static LogFile logFile_;
119 static void write(
const std::string& message,
bool isError,
bool dispatch,
bool log);
128 #endif // End #ifndef SZA_UTIL_LOGGER_H
Tagged: Mon May 10 17:23:41 PDT 2004.
Tagged: Sat Mar 27 16:28:13 PST 2004.