std.log available for viewing
Jacob Carlborg
doob at me.com
Sun May 29 11:22:14 PDT 2011
On 2011-05-29 17:10, Jose Armando Garcia wrote:
> Configuring through the command line is optional for example the
> following command line:
>
> $ program --minloglevel=warning --v=3 --logdir=/tmp
>
> Translate to the following in code:
>
> ---
> import std.log;
>
> void main(string[] args)
> {
> FilterConfig filterConfig;
> filterConfig.minSeverity = Level.warning;
> filterCofnig.verboseConfig.maxVerboseLevel = 3;
>
> LoggerConfig loggerConfig;
> loggerConfig.logDirectory = "/tmp";
>
> initializeLogging!SharedLogger(loggerConfig, filterConfig);
>
> //...
> }
> ---
>
> I.e. all the command line options are also available programmatically.
> The reverse is not the case. All programmatic options are not
> available at the command line.
>
> Fine point about 'dfatal' and 'vlog'. I was trying to keep the
> interface as close to glog as possible where it is warranted but I
> have not problem changing it to 'debugFatal' and 'verbose'.
>
> Thanks,
> -Jose
I guess that that is acceptable. BTW, what happens if you start logging
without passing any command line arguments or initializing the library?
Does it have a default behavior making it usable?
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list