Utility class to log information to the terminal and file
Usage:
(1) Filename defaults to 'csci441GL.log', call setLogFilename() at program start to change the output file name (2) At program start, call resetLogFile() to clear prior file if one exists. Otherwise, new logs will continue to be appended to existing file.
More...
|
| void | setLogFilename (const char *filename) |
| | change the name of the log file that messages are saved to
|
| |
|
void | resetLogFile () |
| | clears contents of log file (if it exists) and prints timestamp to file of when log was initially created
|
| |
| void | log (const char *MSG,...) |
| | log a message to both the standard output stream and file
|
| |
| void | logError (const char *MSG,...) |
| | log a message to both the standard error stream and file
|
| |
| void | logToTerminal (const char *MSG,...) |
| | log a message to the standard output stream
|
| |
| void | logToFile (const char *MSG,...) |
| | log a message to file
|
| |
Utility class to log information to the terminal and file
Usage:
(1) Filename defaults to 'csci441GL.log', call setLogFilename() at program start to change the output file name (2) At program start, call resetLogFile() to clear prior file if one exists. Otherwise, new logs will continue to be appended to existing file.
◆ log()
| void CSCI441::LogUtils::log |
( |
const char * |
MSG, |
|
|
|
... |
|
) |
| |
|
inline |
log a message to both the standard output stream and file
- Parameters
-
| MSG | formatted string to print |
| ... | optional arguments to inject into string |
◆ logError()
| void CSCI441::LogUtils::logError |
( |
const char * |
MSG, |
|
|
|
... |
|
) |
| |
|
inline |
log a message to both the standard error stream and file
- Parameters
-
| MSG | formatted string to print |
| ... | optional arguments to inject into string |
◆ logToFile()
| void CSCI441::LogUtils::logToFile |
( |
const char * |
MSG, |
|
|
|
... |
|
) |
| |
|
inline |
log a message to file
- Parameters
-
| MSG | formatted string to print |
| ... | optional arguments to inject into string |
◆ logToTerminal()
| void CSCI441::LogUtils::logToTerminal |
( |
const char * |
MSG, |
|
|
|
... |
|
) |
| |
|
inline |
log a message to the standard output stream
- Parameters
-
| MSG | formatted string to print |
| ... | optional arguments to inject into string |
◆ setLogFilename()
| void CSCI441::LogUtils::setLogFilename |
( |
const char * |
filename | ) |
|
|
inline |
change the name of the log file that messages are saved to
- Parameters
-
| filename | name of file to write out to |