#include <logger.hpp>
Public Member Functions | |
| file_logger () | |
| bool | set_log_file (std::string file) |
| destructor. flushes and closes the current logger file | |
| void | set_log_to_console (bool consolelog) |
| If consolelog is true, subsequent logger output will be written to stderr. | |
| std::string | get_log_file (void) |
| Returns the current logger file. | |
| bool | get_log_to_console () |
| Returns true if output is being written to stderr. | |
| int | get_log_level () |
| Returns the current logger level. | |
| file_logger & | start_stream (int lineloglevel, const char *file, const char *function, int line) |
| template<typename T > | |
| file_logger & | operator<< (T a) |
| file_logger & | operator<< (const char *a) |
| file_logger & | operator<< (std::ostream &(*f)(std::ostream &)) |
| void | set_log_level (int new_log_level) |
| void | _log (int loglevel, const char *file, const char *function, int line, const char *fmt, va_list arg) |
| void | _logbuf (int loglevel, const char *file, const char *function, int line, const char *buf, int len) |
| void | _lograw (int loglevel, const char *buf, int len) |
| void | stream_flush () |
logging class. This writes to a file, and/or the system console.
Definition at line 121 of file logger.hpp.
| file_logger::file_logger | ( | ) |
Default constructor. By default, log_to_console is off, there is no logger file, and logger level is set to LOG_WARNING
| void file_logger::_log | ( | int | loglevel, | |
| const char * | file, | |||
| const char * | function, | |||
| int | line, | |||
| const char * | fmt, | |||
| va_list | arg | |||
| ) |
logs the message if loglevel>=OUTPUTLEVEL This function should not be used directly. Use logger()
| loglevel | Type of message |
| file | File where the logger call originated | |
| function | Function where the logger call originated | |
| line | Line number where the logger call originated | |
| fmt | printf format string | |
| arg | var args. The parameters that match the format string |
| bool file_logger::set_log_file | ( | std::string | file | ) |
destructor. flushes and closes the current logger file
Closes the current logger file if one exists. if 'file' is not an empty string, it will be opened and all subsequent logger output will be written into 'file'. Any existing content of 'file' will be cleared. Return true on success and false on failure.
| void file_logger::set_log_level | ( | int | new_log_level | ) | [inline] |
Sets the current logger level. All logging commands below the current logger level will not be written.
Definition at line 220 of file logger.hpp.
1.7.1