Early review of std.logger

Robert Schadek realburner at gmx.de
Mon Oct 14 14:22:41 PDT 2013


On 10/14/2013 07:01 PM, Jeremy Powers wrote:
> Some comments from the peanut gallery:
>
> * Mentioned already: configurable log output.  Configure
> style/contents of log output based on output location.  More options
> for included info (thread id, etc).  Allow custom info to be inserted
> based on logger context.
I don't think that this is a good way to good, complexity and speed wise.
>
> * Also mentioned: Configurable log rotation for file logger.
>
> * Pass an exception to logger directly, have it output in message
> depending on configuration.  Pretty vs. short vs. all-one-line for
> automated log parsing.
I think format("%s", someException) already calls toString on
someException (I need to this.)
>
> * Support multiple output locations.  Code calls log.whatever(), be
> able to have that spit out to various places (stdout, syslog, file,
> etc) depending on configuration. Be able to configure different
> logging levels for each output.
MultiLogger will come.
>
> * Should be able to change log levels via configuration, for debugging
> of existing code (during dev or production).  That is, be able to
> change each logger level without recompiling.
Debug Level are runtime only, You can disable all logging via a version
switch
>
> * The 'critical' level seem extraneous - when would you use this
> instead of error or fatal?
The system has tripped bad. Maybe some config file is not there, but
some system env might to the trick.
>
> * Easy way to create logger per module, inheriting settings from
> logger hierarchy.  Associated way to manage loggers and their
> configuration.
>
module myModule;
Logger myModuleLogger;
static this() {
    myModuleLogger = new StdIOLogger();
}
>
> Basically, things I've found useful after using log4j heavily.  Most
> of them seem fancy and extraneous, until you are dealing with
> long-running production software you have to fix at three in the
> morning...



More information about the Digitalmars-d mailing list