std.logger

Robert Schadek realburner at gmx.de
Thu Aug 22 08:17:02 PDT 2013


On 08/22/2013 05:06 PM, Johannes Pfau wrote:
> It would be nice to finally have logging in phobos.
> Two small nit-picks:
>
> The API doesn't follow the phobos naming conventions: functions (error,
> fatal, ...) need to start with a lowercase letter. Same for enum
> members. See http://dlang.org/dstyle.html
I know. I did this because with the last logger, people where
complaining that log, info, warning ... where to common names.
I'm very open for suggestion here. lowercase or otherwise.
> I guess the function string for writeLogMsg is fully-qualified? I'd
> like to see module and function split into two parts. Or fully-qualified
> function + module so the fully qualified function name can be sliced to
> strip the module name: auto fn = func[module.length .. $]
This is what is done inside of StdIOLogger and FileLogger. I did not
want to do this splitting in Logger.logMessage
as the user could rewrite that to fit its need. Maybe I can add two
static method that return the modulename and the function name.



More information about the Digitalmars-d mailing list