Gnash  0.8.11dev
Public Types | Public Member Functions | Static Public Member Functions | List of all members
gnash::LogFile Class Reference

#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) More...
 
void log (const std::string &msg)
 Intended for use by log_*(). Thread-safe (locks _ioMutex) More...
 
bool removeLog ()
 Remove the log file. More...
 
bool closeLog ()
 Close the log file. More...
 
void setLogFilename (const std::string &fname)
 Set log filename. More...
 
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. More...
 
bool getWriteDisk () const
 
void registerLogCallback (logListener l)
 

Static Public Member Functions

static LogFilegetDefaultInstance ()
 

Member Typedef Documentation

typedef void(* gnash::LogFile::logListener) (const std::string &s)

Member Enumeration Documentation

Enumerator
CLOSED 
OPEN 
INPROGRESS 
IDLE 
Enumerator
LOG_SILENT 
LOG_NORMAL 
LOG_DEBUG 
LOG_EXTRA 

Constructor & Destructor Documentation

gnash::LogFile::~LogFile ( )

References closeLog(), and OPEN.

Member Function Documentation

bool gnash::LogFile::closeLog ( )

Close the log file.

Locks _ioMutex to prevent race conditions accessing _outstream

References CLOSED, and OPEN.

Referenced by setLogFilename(), setWriteDisk(), and ~LogFile().

int gnash::LogFile::getActionDump ( ) const
inline
LogFile & gnash::LogFile::getDefaultInstance ( )
static
int gnash::LogFile::getNetwork ( ) const
inline
int gnash::LogFile::getParserDump ( ) const
inline
bool gnash::LogFile::getStamp ( ) const
inline
int gnash::LogFile::getVerbosity ( ) const
inline
bool gnash::LogFile::getWriteDisk ( ) const
inline
void gnash::LogFile::log ( const std::string &  label,
const std::string &  msg 
)
inline

Intended for use by log_*(). Thread-safe (locks _ioMutex)

Parameters
labelThe label string ie: "ERROR" for "ERROR: <msg>"
msgThe message string ie: "bah" for "ERROR: bah"

Referenced by gnash::processLog_abc(), gnash::processLog_action(), gnash::processLog_aserror(), gnash::processLog_debug(), gnash::processLog_error(), gnash::processLog_network(), gnash::processLog_parse(), gnash::processLog_security(), gnash::processLog_swferror(), gnash::processLog_trace(), and gnash::processLog_unimpl().

void gnash::LogFile::log ( const std::string &  msg)

Intended for use by log_*(). Thread-safe (locks _ioMutex)

Parameters
msgThe message to print
void gnash::LogFile::registerLogCallback ( logListener  l)
inline

References gnash::key::l.

bool gnash::LogFile::removeLog ( )

Remove the log file.

Does NOT lock _ioMutex (should it?)

References OPEN.

Referenced by main().

void gnash::LogFile::setActionDump ( int  x)
inline

References x.

Referenced by main().

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::setNetwork ( int  x)
inline

References x.

Referenced by main().

void gnash::LogFile::setParserDump ( int  x)
inline

References x.

Referenced by main().

void gnash::LogFile::setStamp ( bool  b)
inline

References gnash::key::b.

Referenced by gnash::processLog_action().

void gnash::LogFile::setVerbosity ( )
inline
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 main(), and nsPluginInstance::threadMain().


The documentation for this class was generated from the following files: