Proud::CLogWriter Class Referenceabstract

Public Types

enum  eLogType { eLogTypeNewFile = 0, eLogTypeDefault, eLogTypeUserDefine }
 

Public Member Functions

virtual void SetFileName (const String &logFileName)=0
 
virtual void WriteLine (int logLevel, LogCategory logCategory, HostID logHostID, const String &logMessage, const String &logFunction=_PNT(""), int logLine=0)=0
 
virtual void WriteLine (const String &logMessage)=0
 
virtual void SetIgnorePendedWriteOnExit (bool flag)=0
 

Static Public Member Functions

static PROUD_API CLogWriterNew (const String &logFileName, unsigned int newFileForLineLimit=0, bool putFileTimeString=true)
 Generate a new CLogWriter object.
 

Detailed Description

Module that records log to a file (Refer Making a PIDL file )

General usage

  • Use CLogWriter.New to create this object. Designates log file name when created.
  • Use WriteLine, WriteLine to record log. Saved log is saved in file as asynchronous.

Member Function Documentation

static PROUD_API CLogWriter* Proud::CLogWriter::New ( const String logFileName,
unsigned int  newFileForLineLimit = 0,
bool  putFileTimeString = true 
)
static

Generate a new CLogWriter object.

TODO:translate needed.

Parameters
logFileNamelog file name.
newFileForLineLimitIf the number of the log lines gets bigger than the designated value her, then it starts recording in a new log file. It is limitless if 0.
putFileTimeStringIf set as “true”, the current time information (year/month/date/hour/minute/second) is added to prevent duplication of file names.
virtual void Proud::CLogWriter::SetFileName ( const String logFileName)
pure virtual

The log file is changed to another name. The file being recorded is closed and opens newly as a file changed to a different name.

  • This function is executed asynchronously. In other words, it is returned immediately.
  • If the log file fails to change to a different name, this function does not return the error. Instead, Proud.Exception exception will occur when the function to record the log is used.
    Parameters
    logFileNameNew log file name
virtual void Proud::CLogWriter::SetIgnorePendedWriteOnExit ( bool  flag)
pure virtual
  • This determines whether to output the rest of the logs not yet output when the object is terminated (ended) or ignore them.
  • The default value is false.
  • If set true, it terminates immediately even if there is a log not yet output.
  • If set false, termination is delayed until not yet output logs are all output.
Parameters
flagWhether to use this option or not.
virtual void Proud::CLogWriter::WriteLine ( int  logLevel,
LogCategory  logCategory,
HostID  logHostID,
const String logMessage,
const String logFunction = _PNT(""),
int  logLine = 0 
)
pure virtual

One line of the log is recorded in the file in the ProudNet format.

  • This function is executed asynchronously. In other words, it is returned immediately.
  • This function is finally output as the examples below. logWriteLineTime: logLevel / logCategory(logHostID): logMessage {logFunction(logLine)}
    Parameters
    logLevelSeverity of the log content
    logCategoryWhat type of a log is this?
    logHostIDThe host transmitting this log.
    logMessageLog message
    logFunctionName of the function that has called the log
    logLineLine that has called the log
virtual void Proud::CLogWriter::WriteLine ( const String logMessage)
pure virtual

Writes a line of log to the file

  • This function is asynchronous so returned immediately.
  • But not like void WriteLine(TraceID TID, LPCWSTR text), does not have any header.
    Parameters
    logMessagetext string to record log.
  • You are able to use string type or WriteLine(String::NewFormat(L"Test Log %d", 10)) type