Gnash
0.8.10
|
#include <log.h>
Public Types | |
enum | LogLevel { LOG_SILENT, LOG_NORMAL, LOG_DEBUG, LOG_EXTRA } |
enum | FileState { CLOSED, OPEN, INPROGRESS, IDLE } |
typedef void(* | logListener )(const std::string &s) |
Public Member Functions | |
~LogFile () | |
void | log (const std::string &label, const std::string &msg) |
Intended for use by log_*(). Thread-safe (locks _ioMutex) | |
void | log (const std::string &msg) |
Intended for use by log_*(). Thread-safe (locks _ioMutex) | |
bool | removeLog () |
Remove the log file. | |
bool | closeLog () |
Close the log file. | |
void | setLogFilename (const std::string &fname) |
Set log filename. | |
void | setVerbosity () |
void | setVerbosity (int x) |
int | getVerbosity () const |
void | setActionDump (int x) |
void | setNetwork (int x) |
int | getActionDump () const |
int | getNetwork () const |
void | setParserDump (int x) |
int | getParserDump () const |
void | setStamp (bool b) |
bool | getStamp () const |
void | setWriteDisk (bool b) |
Set whether to write logs to file. | |
bool | getWriteDisk () const |
void | registerLogCallback (logListener l) |
Static Public Member Functions | |
static LogFile & | getDefaultInstance () |
typedef void(* gnash::LogFile::logListener)(const std::string &s) |
gnash::LogFile::~LogFile | ( | ) |
References OPEN, and closeLog().
bool gnash::LogFile::closeLog | ( | ) |
Close the log file.
Locks _ioMutex to prevent race conditions accessing _outstream
Referenced by setLogFilename(), setWriteDisk(), and ~LogFile().
int gnash::LogFile::getActionDump | ( | ) | const [inline] |
LogFile & gnash::LogFile::getDefaultInstance | ( | ) | [static] |
References gnash::key::o.
Referenced by nsPluginInstance::threadMain(), and main().
int gnash::LogFile::getNetwork | ( | ) | const [inline] |
int gnash::LogFile::getParserDump | ( | ) | const [inline] |
bool gnash::LogFile::getStamp | ( | ) | const [inline] |
Referenced by gnash::processLog_action().
int gnash::LogFile::getVerbosity | ( | ) | const [inline] |
Referenced by gnash::processLog_debug(), and gnash::processLog_abc().
bool gnash::LogFile::getWriteDisk | ( | ) | const [inline] |
References _write.
void gnash::LogFile::log | ( | const std::string & | label, |
const std::string & | msg | ||
) | [inline] |
Intended for use by log_*(). Thread-safe (locks _ioMutex)
label | The label string ie: "ERROR" for "ERROR: <msg>" |
msg | The message string ie: "bah" for "ERROR: bah" |
Referenced by gnash::processLog_trace(), gnash::processLog_debug(), gnash::processLog_abc(), gnash::processLog_parse(), gnash::processLog_network(), gnash::processLog_error(), gnash::processLog_unimpl(), gnash::processLog_security(), gnash::processLog_swferror(), gnash::processLog_aserror(), and gnash::processLog_action().
void gnash::LogFile::log | ( | const std::string & | msg | ) |
Intended for use by log_*(). Thread-safe (locks _ioMutex)
msg | The message to print |
void gnash::LogFile::registerLogCallback | ( | logListener | l | ) | [inline] |
References gnash::key::l.
bool gnash::LogFile::removeLog | ( | ) |
void gnash::LogFile::setLogFilename | ( | const std::string & | fname | ) |
Set log filename.
If a log file is opened already, it will be closed by this call, and will be reopened on next use if needed.
References closeLog().
Referenced by main().
void gnash::LogFile::setStamp | ( | bool | b | ) | [inline] |
References gnash::key::b.
Referenced by gnash::processLog_action().
void gnash::LogFile::setVerbosity | ( | ) | [inline] |
Referenced by gnash::EventDevice::init(), nsPluginInstance::threadMain(), and main().
void gnash::LogFile::setVerbosity | ( | int | x | ) | [inline] |
References x.
void gnash::LogFile::setWriteDisk | ( | bool | b | ) |
Set whether to write logs to file.
References closeLog().
Referenced by nsPluginInstance::threadMain(), and main().