![]() |
Dragonfly 4.22
A text-based game engine
|

Public Member Functions | |
| ~LogManager () | |
| int | startUp () override |
| void | shutDown () override |
| int | writeLog (const char *fmt,...) const |
| int | writeLog (int log_level, const char *fmt,...) const |
| int | writeMyLog (std::string filename, const char *fmt,...) |
| int | writeMyLog (std::string filename, int log_level, const char *fmt,...) |
| void | setLogLevel (int new_log_level) |
| int | getLogLevel () const |
| void | setFlush (bool do_flush=true) |
| void | flush () |
| void | setLogTimeString (bool log_time_string=true) |
| void | setLogStepCount (bool log_step_count=true) |
Public Member Functions inherited from df::Manager | |
| std::string | getType () const |
| virtual int | startUp () |
| virtual void | shutDown () |
| bool | isStarted () const |
| int | onEvent (const Event *p_event) const |
| int | registerInterest (Object *p_o, std::string event_type) |
| int | unregisterInterest (Object *p_o, std::string event_type) |
Static Public Member Functions | |
| static LogManager & | getInstance () |
Private Member Functions | |
| LogManager () | |
| LogManager (LogManager const &) | |
| void | operator= (LogManager const &) |
Private Attributes | |
| bool | m_do_flush |
| int | m_log_level |
| bool | m_log_time_string |
| bool | m_log_step_count |
| FILE * | m_p_f |
| std::map< std::string, FILE * > | m_file_list |
Additional Inherited Members | |
Protected Member Functions inherited from df::Manager | |
| void | setType (std::string new_type) |
|
private |
Private since a singleton.
|
private |
Don't allow copy.
| df::LogManager::~LogManager | ( | ) |
If logfile is open, close it.
| void df::LogManager::flush | ( | ) |
Flush the logfile.
|
static |
Get the one and only instance of the LogManager.
| int df::LogManager::getLogLevel | ( | ) | const |
Get logging level.
|
private |
Don't allow assignment.
| void df::LogManager::setFlush | ( | bool | do_flush = true | ) |
Set flush of logfile after each write.
| void df::LogManager::setLogLevel | ( | int | new_log_level | ) |
Set logging level.
| void df::LogManager::setLogStepCount | ( | bool | log_step_count = true | ) |
Set prepend step count to log messages.
| void df::LogManager::setLogTimeString | ( | bool | log_time_string = true | ) |
Set prepend time string to log messages.
|
overridevirtual |
Shut down LogManager (close all logfiles).
Reimplemented from df::Manager.
|
overridevirtual |
Start up LogManager (open main logfile, usually "dragonfly.log").
Return 0 if ok, else -1.
Reimplemented from df::Manager.
| int df::LogManager::writeLog | ( | const char * | fmt, |
| ... | |||
| ) | const |
Write to logfile.
Supports printf() formatting of strings. Return number of bytes written (excluding prepends), -1 if error.
| int df::LogManager::writeLog | ( | int | log_level, |
| const char * | fmt, | ||
| ... | |||
| ) | const |
Write to logfile.
Only write if indicated log level >= LogManager log level. Supports printf() formatting of strings. Return number of bytes written (excluding prepends), -1 if error.
| int df::LogManager::writeMyLog | ( | std::string | filename, |
| const char * | fmt, | ||
| ... | |||
| ) |
Write to custom logfile, identified by filename.
Supports printf() formatting of strings. Return number of bytes written (excluding prepends), -1 if error.
| int df::LogManager::writeMyLog | ( | std::string | filename, |
| int | log_level, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Write to custom logfile, identified by filename.
Only write if indicated log level >= LogManager log level. Supports printf() formatting of strings. Return number of bytes written (excluding prepends), -1 if error.
|
private |
True if flush to disk after write.
|
private |
List of custom logfiles.
|
private |
Logging level.
|
private |
True if prepend step count.
|
private |
True if prepend time.
|
private |
Pointer to main logfile.