gfx.core.log

Logging module

This module provides logging functionality. Everything is thread-safe at the exception of global severity and mask getters/setters. This is done so to avoid paying for synchronization of log entries that will be filtered out.

Members

Classes

FileLogger
class FileLogger

A logger that prints into a file

StdErrLogger
class StdErrLogger

A logger that prints to stderr

StdOutLogger
class StdOutLogger

A logger that prints to stdout

Enums

Severity
enum Severity

Log messages severity

Functions

debug_
void debug_(string tag, string msg)
void debug_(uint mask, string tag, string msg)
debugf
void debugf(string tag, string fmt, Args args)
void debugf(uint mask, string tag, string fmt, Args args)

add a log entry with debug severity

error
void error(string tag, string msg)
void error(uint mask, string tag, string msg)
errorf
void errorf(string tag, string fmt, Args args)
void errorf(uint mask, string tag, string fmt, Args args)

add a log entry with error severity

info
void info(string tag, string msg)
void info(uint mask, string tag, string msg)
infof
void infof(string tag, string fmt, Args args)
void infof(uint mask, string tag, string fmt, Args args)

add a log entry with info severity

log
void log(Severity sev, string tag, string msg)
void log(Severity sev, uint mask, string tag, string msg)
logf
void logf(Severity sev, string tag, string fmt, Args args)
void logf(Severity sev, uint mask, string tag, string fmt, Args args)

add a log entry

trace
void trace(string tag, string msg)
void trace(uint mask, string tag, string msg)
tracef
void tracef(string tag, string fmt, Args args)
void tracef(uint mask, string tag, string fmt, Args args)

add a log entry with trace severity

warning
void warning(string tag, string msg)
void warning(uint mask, string tag, string msg)
warningf
void warningf(string tag, string fmt, Args args)
void warningf(uint mask, string tag, string fmt, Args args)

add a log entry with warning severity

Interfaces

Logger
interface Logger

An abstract logger. All log operations are synchronized by a global mutex. Implementations do not need to bother about thread safety.

Manifest constants

defaultSeverity
enum defaultSeverity;

The default severity

defaultSeverity
enum defaultSeverity;

The default severity

Properties

logger
Logger logger [@property getter]
void logger [@property getter]

The installed logger. By default StdOutLogger. Assigning null re-assign the default

mask
uint mask [@property getter]
void mask [@property getter]

A mask for bypassing some messages. By default 0xffffffff

msgFormat
string msgFormat [@property getter]
void msgFormat [@property getter]

The format string for log messages The entries are as follow: - %d: datetime (formatted according timeFormat) - %s: severity - %p: padding of severity - %t: tag - %m: msg The default format string is defaultMsgFormat

severity
Severity severity [@property getter]
void severity [@property getter]

Minimum Severity for message filtering. All messages with lower severity are filtered out. By default Severity.info in release builds and Severity.debug_ in debug builds.

timeFormat
string timeFormat [@property getter]
void timeFormat [@property getter]

The format string for date-time in log message The format of this string is the same as smjg.libs.util.datetime: http://pr.stewartsplace.org.uk/d/sutil/doc/datetimeformat.html

Structs

LogTag
struct LogTag

LogTag encapsulate a string tag and a bitmask. It a also have helpers to log entries with the given tag and mask.

Variables

defaultMask
enum uint defaultMask;

The default filter mask

defaultMsgFormat
enum string defaultMsgFormat;

the default format string for log messages

defaultTimeFormat
enum string defaultTimeFormat;

the default format string for date-time

Meta