On this page:
log-fatal*
log-error*
log-warning*
log-info*
log-debug*
start-log-output
current-log-formatter
Version: 4.2.0.5

17 Logging utilities

 (require (planet untyped/unlib/log))

This module adds some useful features to the core logging functionality of PLT Scheme:

Application log messages are not reported until a call is made to start-log-output, or until a call is made to log-receiver.

(log-fatal* any ...)

Adds a fatal error message to the application log. The arguments are formatted them into a single-line log message together with the message level and current time. The time is returned as a SRFI 19 time-utc?.

(log-error* any ...)

Adds a non-fatal error message to the application log. Behaviour is similar to that of log-fatal*.

(log-warning* any ...)

Adds a warning message to the application log. Behaviour is similar to that of log-fatal*.

(log-info* any ...)

Adds an informational message to the application log. Behaviour is similar to that of log-fatal*.

(log-debug* any ...)

Adds a debugging message to the application log. Behaviour is similar to that of log-fatal*.

(start-log-output level [handler])  (-> void?)
  level : (U 'fatal 'error 'warning 'info 'debug)
  handler : handler-procedure = default-log-handler

Starts a thread that handles application lof messages of the specified level or above. Returns a thunk that stops the logging thread and terminates output.

handler is called each time a message is logged, and should accept three arguments:

If handler is omitted, a default-handler-procedure is used that prints all messages to the current-output-port.

(current-log-formatter)
  (log-level time-utc? list? -> string?)
(current-log-formatter formatter)  void?
  formatter : (log-level time-utc? list? -> string?)

Parameter that customises the formatting of application log messages. The value must be a procedure that takes three arguments: