On this page:
start-logger

17 Logging🔗

 (require koyo/logging) package: koyo-lib

This module provides utilities for displaying log messages.

procedure

(start-logger #:levels levels    
  [#:color? color?    
  #:parent parent    
  #:output-port out])  (-> void?)
  levels : (listof (cons/c symbol? log-level/c))
  color? : boolean? = #t
  parent : logger? = (current-logger)
  out : port? = (current-error-port)
Starts a background thread that receives logs based on levels and writes them to out in the following format:

    [<timestamp>] [<pid>] [<level>] <topic>: <message>

The levels argument is a list of topic and level pairs. The debug, info, warning and error <level>s are colored using ANSI escape sequences unless #:color? is #f.

The return value is a function that will stop the background thread when called. Calling the stopper function after the thread has been stopped has no effect.