Review: std.logger

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 14 10:53:31 PDT 2014


On Monday, 14 July 2014 at 17:44:37 UTC, Jeremy Powers via 
Digitalmars-d wrote:
> Is this where I talk about hierarchical logging?
>
> There was some talk in the original review thread about having 
> each log
> import create or tag the log with the module, so one could 
> refer to and
> filter by modules.  In java land you get a logger instance per 
> class, in a
> tree based on package hierarchy, and can then configure output 
> levels
> differently for various places in the hierarchy - very useful 
> (esp. with
> runtime configuration).
>
> While discussing the proper way to namespace/import logger, can 
> you make it
> such that doing so gives hierarchical logging?

Replacing `import log = std.logger` with something like this:

```
import std.logger.modulelog;
auto log = new ModuleLogger;
```

should do the trick as far as I understand the current design - 
this assumes that module/package name filters are implemented as 
static ModuleLogger fields.


More information about the Digitalmars-d mailing list