Gnash  0.8.10
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 OPEN, and closeLog().


Member Function Documentation

bool gnash::LogFile::closeLog ( )

Close the log file.

Locks _ioMutex to prevent race conditions accessing _outstream

References OPEN, and CLOSED.

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]
int gnash::LogFile::getVerbosity ( ) const [inline]
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)

Parameters:
labelThe label string ie: "ERROR" for "ERROR: <msg>"
msgThe 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)

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 nsPluginInstance::threadMain(), and main().


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