Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::FileLogger Class Reference

Core class that represents a file logger. More...

Inheritance diagram for Nz::FileLogger:
Nz::AbstractLogger

Public Member Functions

 FileLogger (const String &logPath="NazaraLog.log")
 Constructs a FileLogger object with a file name. More...
 
 FileLogger (const FileLogger &)=default
 
 FileLogger (FileLogger &&)=default
 
 ~FileLogger ()
 Destructs the object.
 
void EnableTimeLogging (bool enable)
 Enables the log of the time. More...
 
void EnableStdReplication (bool enable) override
 Enables the replication to the stdout. More...
 
bool IsStdReplicationEnabled () const override
 Checks whether or not the replication to the stdout is enabled. More...
 
bool IsTimeLoggingEnabled () const
 Checks whether or not the logging of the time is enabled. More...
 
void Write (const String &string) override
 Writes a string in the log. More...
 
void WriteError (ErrorType type, const String &error, unsigned int line=0, const char *file=nullptr, const char *function=nullptr) override
 Writes an error in the log. More...
 
FileLoggeroperator= (const FileLogger &)=default
 
FileLoggeroperator= (FileLogger &&)=default
 

Detailed Description

Core class that represents a file logger.

Constructor & Destructor Documentation

◆ FileLogger()

Nz::FileLogger::FileLogger ( const String logPath = "NazaraLog.log")

Constructs a FileLogger object with a file name.

Parameters
logPathPath to log

Member Function Documentation

◆ EnableStdReplication()

void Nz::FileLogger::EnableStdReplication ( bool  enable)
overridevirtual

Enables the replication to the stdout.

Parameters
enableIf true, enables the replication

Implements Nz::AbstractLogger.

◆ EnableTimeLogging()

void Nz::FileLogger::EnableTimeLogging ( bool  enable)

Enables the log of the time.

Parameters
enableIf true, enables the time log

◆ IsStdReplicationEnabled()

bool Nz::FileLogger::IsStdReplicationEnabled ( ) const
overridevirtual

Checks whether or not the replication to the stdout is enabled.

Returns
true If replication is enabled

Implements Nz::AbstractLogger.

◆ IsTimeLoggingEnabled()

bool Nz::FileLogger::IsTimeLoggingEnabled ( ) const

Checks whether or not the logging of the time is enabled.

Returns
true If logging of the time is enabled

◆ Write()

void Nz::FileLogger::Write ( const String string)
overridevirtual

Writes a string in the log.

Parameters
stringString to log
Remarks
Produces a NazaraError if file could not be opened
See also
WriteError

Implements Nz::AbstractLogger.

◆ WriteError()

void Nz::FileLogger::WriteError ( ErrorType  type,
const String error,
unsigned int  line = 0,
const char *  file = nullptr,
const char *  function = nullptr 
)
overridevirtual

Writes an error in the log.

Parameters
typeThe error type
errorThe error text
lineThe line the error occurred
fileThe file the error occurred
functionThe function the error occurred
See also
Write

Reimplemented from Nz::AbstractLogger.


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