Skip to contents

The LoggerNull class overwrites the functions of the Logger so no logging is produced. Errors and warnings are still produced.

Value

A new instance of the LoggerNull R6 class.

Super class

SCDB::Logger -> LoggerNull

Methods

Inherited methods


Method new()

Create a new LoggerNull object

Usage

LoggerNull$new(...)

Arguments

...

Captures arguments given, but does nothing


Method log_to_db()

Matches the signature of Logger$log_to_db(), but does nothing.

Usage

LoggerNull$log_to_db(...)

Arguments

...

Captures arguments given, but does nothing


Method finalize_db_entry()

Matches the signature of Logger$finalize_db_entry(), but does nothing.

Usage

LoggerNull$finalize_db_entry(...)

Arguments

...

Captures arguments given, but does nothing


Method clone()

The objects of this class are cloneable with this method.

Usage

LoggerNull$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

  logger <- LoggerNull$new()

  logger$log_info("This message will not print!")
  logger$log_to_db(message = "This message will no be written in database!")
  try(logger$log_warn("This is a warning!"))
#> Warning: 2024-10-04 07:59:12.580 - runner - WARNING - This is a warning!
  try(logger$log_error("This is an error!"))
#> Error in logger$log_error("This is an error!") : 
#>   2024-10-04 07:59:12.581 - runner - ERROR - This is an error!