Public Types | Public Member Functions | Static Public Member Functions

gnash::LogFile Class Reference

#include <log.h>

List of all members.

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 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 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:
label The label string ie: "ERROR" for "ERROR: <msg>"
msg The message string ie: "bah" for "ERROR: bah"
void gnash::LogFile::log ( const std::string &  msg  ) 

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

Parameters:
msg The message to print

References gnash::timestamp().

void gnash::LogFile::registerLogCallback ( logListener  l  )  [inline]
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]

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]

Referenced by main().

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

Referenced by main().

void gnash::LogFile::setStamp ( bool  b  )  [inline]
void gnash::LogFile::setVerbosity (  )  [inline]
void gnash::LogFile::setVerbosity ( int  x  )  [inline]
void gnash::LogFile::setWriteDisk ( bool  b  ) 

Set whether to write logs to file.

References closeLog().

Referenced by main().


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