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

§ logListener

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

Member Enumeration Documentation

§ FileState

Enumerator
CLOSED 
OPEN 
INPROGRESS 
IDLE 

§ LogLevel

Enumerator
LOG_SILENT 
LOG_NORMAL 
LOG_DEBUG 
LOG_EXTRA 

Constructor & Destructor Documentation

§ ~LogFile()

gnash::LogFile::~LogFile ( )

References CLOSED, closeLog(), DEFAULT_LOGFILE, and OPEN.

Member Function Documentation

§ closeLog()

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().

§ getActionDump()

int gnash::LogFile::getActionDump ( ) const
inline

§ getDefaultInstance()

LogFile & gnash::LogFile::getDefaultInstance ( )
static

References gnash::dbglogfile, and gnash::key::o.

Referenced by gnash::Socket::connect(), and main().

§ getNetwork()

int gnash::LogFile::getNetwork ( ) const
inline

§ getParserDump()

int gnash::LogFile::getParserDump ( ) const
inline

§ getStamp()

bool gnash::LogFile::getStamp ( ) const
inline

References gnash::key::b.

Referenced by gnash::processLog_action().

§ getVerbosity()

int gnash::LogFile::getVerbosity ( ) const
inline

§ getWriteDisk()

bool gnash::LogFile::getWriteDisk ( ) const
inline

§ log() [1/2]

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().

§ log() [2/2]

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

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

Parameters
msgThe message to print

§ registerLogCallback()

void gnash::LogFile::registerLogCallback ( logListener  l)
inline

§ removeLog()

bool gnash::LogFile::removeLog ( )

Remove the log file.

Does NOT lock _ioMutex (should it?)

References OPEN.

§ setActionDump()

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

References x.

Referenced by gnash::Player::setScale().

§ setLogFilename()

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 gnash::Player::setScale().

§ setNetwork()

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

References x.

§ setParserDump()

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

References x.

Referenced by gnash::Player::setScale().

§ setStamp()

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

References gnash::key::b.

Referenced by gnash::processLog_action().

§ setVerbosity() [1/2]

void gnash::LogFile::setVerbosity ( )
inline

Referenced by main(), and gnash::Player::setScale().

§ setVerbosity() [2/2]

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

References x.

§ setWriteDisk()

void gnash::LogFile::setWriteDisk ( bool  b)

Set whether to write logs to file.

References CLOSED, and closeLog().

Referenced by gnash::Player::setScale().


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