Learn R Programming

pkgnet (version 0.6.0)

SimpleLogger: Simple Logger Class

Description

A minimal logging class using only base R functions. Provides threshold-based logging with INFO, WARN, and FATAL levels.

Arguments

Methods


Method new()

Initialize a new SimpleLogger

Usage

SimpleLogger$new(threshold = 0)

Arguments

threshold

Initial threshold level (default: 0 for silent)

Returns

A new SimpleLogger instance


Method info()

Log an informational message

Usage

SimpleLogger$info(msg, ...)

Arguments

msg

Message to log

...

Additional arguments (currently ignored)

Returns

NULL invisibly


Method warn()

Log a warning message

Usage

SimpleLogger$warn(msg, ...)

Arguments

msg

Message to log

...

Additional arguments (currently ignored)

Returns

NULL invisibly


Method fatal()

Log a fatal error message

Usage

SimpleLogger$fatal(msg, ...)

Arguments

msg

Message to log

...

Additional arguments (currently ignored)

Returns

NULL invisibly


Method get_threshold()

Get current threshold

Usage

SimpleLogger$get_threshold()

Returns

Current threshold value


Method set_threshold()

Set threshold level

Usage

SimpleLogger$set_threshold(level)

Arguments

level

Threshold level (0 = silent, 4 = INFO, 5 = WARN, 6 = FATAL)

Returns

NULL invisibly


Method clone()

The objects of this class are cloneable with this method.

Usage

SimpleLogger$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.