Module 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.

Functions

NameDescription
debug_(tag, msg) add a log entry with debug severity
debugf(tag, fmt, args) add a log entry with debug severity
error(tag, msg) add a log entry with error severity
errorf(tag, fmt, args) add a log entry with error severity
info(tag, msg) add a log entry with info severity
infof(tag, fmt, args) add a log entry with info severity
log(sev, tag, msg) add a log entry
logf(sev, tag, fmt, args) add a log entry
logger() The installed logger. By default StdOutLogger. Assigning null re-assign the default
mask() A mask for bypassing some messages. By default 0xffffffff
msgFormat() 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() 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() The format string for date-time in log message The format of this string is the same as smjg.libs.util.datetime:
trace(tag, msg) add a log entry with trace severity
tracef(tag, fmt, args) add a log entry with trace severity
warning(tag, msg) add a log entry with warning severity
warningf(tag, fmt, args) add a log entry with warning severity

Interfaces

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

Classes

NameDescription
FileLogger A logger that prints into a file
StdErrLogger A logger that prints to stderr
StdOutLogger A logger that prints to stdout

Structs

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

Enums

NameDescription
Severity Log messages severity

Manifest constants

NameTypeDescription
defaultMask The default filter mask
defaultMsgFormat the default format string for log messages
defaultSeverity The default severity
defaultTimeFormat the default format string for date-time