Main   Class List   Namespace List   Wiki

ConsoleLogger Class Reference
[Logging]

Inheritance diagram for ConsoleLogger:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool attach ()
 Attaches the logger to the console and begins writing to file.
bool detach ()
 Detaches the logger from the console and stops writing to file.

Public Attributes

Logging

LogLevel level
 Determines the priority level and attention the logged entry gets when recorded.

Detailed Description

A class designed to be used as a console consumer and log the data it receives to a file.

See also:
dumpConsoleFunctions
dumpConsoleClasses

Member Function Documentation

bool ConsoleLogger::attach (  ) 

Attaches the logger to the console and begins writing to file.

Example:
// Create the logger
// Will automatically start writing to testLogging.txt with normal priority
new ConsoleLogger(logger, "testLogging.txt", false);

// Send something to the console, with the logger consumes and writes to file
echo("This is logged to the file");

// Stop logging, but do not delete the logger
logger.detach();

echo("This is not logged to the file");

// Attach the logger to the console again
logger.attach();

// Logging has resumed
echo("Logging has resumed");
bool ConsoleLogger::detach (  ) 

Detaches the logger from the console and stops writing to file.

Example:
// Create the logger
// Will automatically start writing to testLogging.txt with normal priority
new ConsoleLogger(logger, "testLogging.txt", false);

// Send something to the console, with the logger consumes and writes to file
echo("This is logged to the file");

// Stop logging, but do not delete the logger
logger.detach();

echo("This is not logged to the file");

// Attach the logger to the console again
logger.attach();

// Logging has resumed
echo("Logging has resumed");

Member Data Documentation

Determines the priority level and attention the logged entry gets when recorded.



Copyright © GarageGames, LLC. All Rights Reserved.