[racket] Hierarchical loggers

From: aidalgol at amuri.net (aidalgol at amuri.net)
Date: Wed Jul 2 21:01:19 EDT 2014

What's a sane way to set up hierarchical loggers among a set of modules 
within a program?  Say the main program file main.rkt has a logger named 
'main, and it "require"s module foo which has a logger 'foo, whose 
parent should be 'main.  Module foo also "require"s module bar, which 
has its own logger 'bar, whose parent should be 'foo.  The only two ways 
I can think of achieving this are 1) to have foo and bar provide a 
procedure that takes a logger and defines the module's logger with the 
passed logger as its parent, and 2) having each module unconditionally 
set their loggers parent to the (current-logger) parameter and set that 
parameter to the parent logger before loading each module.  Option 1 
seems much saner, but I'd like some advice on this.

Regards,
Aidan Gauland

Posted on the users mailing list.