5#ifndef __LOG_MANAGER_H__
6#define __LOG_MANAGER_H__
17#define LM df::LogManager::getInstance()
61 int writeLog(
int log_level,
const char *fmt, ...)
const;
66 int writeMyLog(std::string filename,
const char *fmt, ...);
72 int writeMyLog(std::string filename,
int log_level,
const char *fmt, ...);
Definition: LogManager.h:25
int m_log_level
Logging level.
Definition: LogManager.h:32
void flush()
Flush the logfile.
int getLogLevel() const
Get logging level.
bool m_log_time_string
True if prepend time.
Definition: LogManager.h:33
void setLogTimeString(bool log_time_string=true)
Set prepend time string to log messages.
static LogManager & getInstance()
Get the one and only instance of the LogManager.
int writeLog(int log_level, const char *fmt,...) const
Write to logfile.
LogManager()
Private since a singleton.
void setLogStepCount(bool log_step_count=true)
Set prepend step count to log messages.
~LogManager()
If logfile is open, close it.
std::map< std::string, FILE * > m_file_list
List of custom logfiles.
Definition: LogManager.h:36
bool m_do_flush
True if flush to disk after write.
Definition: LogManager.h:31
LogManager(LogManager const &)
Don't allow copy.
int writeMyLog(std::string filename, const char *fmt,...)
Write to custom logfile, identified by filename.
bool m_log_step_count
True if prepend step count.
Definition: LogManager.h:34
void shutDown() override
Shut down LogManager (close all logfiles).
void setFlush(bool do_flush=true)
Set flush of logfile after each write.
int writeMyLog(std::string filename, int log_level, const char *fmt,...)
Write to custom logfile, identified by filename.
int startUp() override
Start up LogManager (open main logfile, usually "dragonfly.log").
FILE * m_p_f
Pointer to main logfile.
Definition: LogManager.h:35
int writeLog(const char *fmt,...) const
Write to logfile.
void operator=(LogManager const &)
Don't allow assignment.
void setLogLevel(int new_log_level)
Set logging level.
An animation for a sprite.
Definition: Animation.h:15
const std::string LOGFILE_DEFAULT
Default Dragonfly logfile.
Definition: LogManager.h:23