Re: Logging and tracing in D
On 2013-08-06 06:35, Andre Artus wrote: What is the recommended approach for adding logging and tracing to D apps? Is there a library for it? Tango contains a package for logging: Docs/tutorial: http://dsource.org/projects/tango/wiki/ChapterLogging API reference: http://dsource.org/projects/tango/docs/current/ D2 port: https://github.com/SiegeLord/Tango-D2 -- /Jacob Carlborg
Re: Logging and tracing in D
On Tuesday, 6 August 2013 at 18:54:50 UTC, Andre Artus wrote: David wrote: There is std.log (proposed), it doesn't work, I don't like its API. I take it that it hasn't been documented yet, at least I could not find it on dlang.org. http://wiki.dlang.org/Review_Queue
Re: Logging and tracing in D
-- snip -- I take it that it hasn't been documented yet, at least I could not find it on dlang.org. It's currently in the review queue: http://wiki.dlang.org/Review_Queue but marked on hold/suspended. Thanks, I'll check it out later.
Re: Logging and tracing in D
Am 06.08.2013 20:54, schrieb Andre Artus: >> David wrote: >> Am 06.08.2013 19:22, schrieb Andre Artus: >>> -- snip-- and you get pretty formatted message in console(add log file writer if needed), and you get "smart" logging for free, in that way it will be generated only for debug mode(in release it will be skipped because of debug specifier). >>> >>> Thanks, can I take it that there is no official library for this kind of >>> thing then? I would think it generally useful. Perhaps it can be >>> considered for inclusion into Phobos. >> >> There is std.log (proposed), it doesn't work, I don't like its API. > > I take it that it hasn't been documented yet, at least I could not find > it on dlang.org. It's currently in the review queue: http://wiki.dlang.org/Review_Queue but marked on hold/suspended.
Re: Logging and tracing in D
On Tue, Aug 06, 2013 at 08:54:48PM +0200, Andre Artus wrote: > >David wrote: > >Am 06.08.2013 19:22, schrieb Andre Artus: > >>-- snip-- > >>>and you get pretty formatted message in console(add log file writer > >>>if needed), and you get "smart" logging for free, in that way it > >>>will be generated only for debug mode(in release it will be skipped > >>>because of debug specifier). > >> > >>Thanks, can I take it that there is no official library for this > >>kind of thing then? I would think it generally useful. Perhaps it > >>can be considered for inclusion into Phobos. > > > >There is std.log (proposed), it doesn't work, I don't like its API. > > I take it that it hasn't been documented yet, at least I could not > find it on dlang.org. [...] Sounds like it's not merged into the official codebase yet. T -- Always remember that you are unique. Just like everybody else. -- despair.com
Re: Logging and tracing in D
David wrote: Am 06.08.2013 19:22, schrieb Andre Artus: -- snip-- and you get pretty formatted message in console(add log file writer if needed), and you get "smart" logging for free, in that way it will be generated only for debug mode(in release it will be skipped because of debug specifier). Thanks, can I take it that there is no official library for this kind of thing then? I would think it generally useful. Perhaps it can be considered for inclusion into Phobos. There is std.log (proposed), it doesn't work, I don't like its API. I take it that it hasn't been documented yet, at least I could not find it on dlang.org. David: I wrote my own logger (consider it MIT licensed) https://github.com/Dav1dde/BraLa/blob/master/brala/utils/log.d I am not 100% happy how it turned out, but I haven't come around to change it, but it works pretty well. Cool, thanks, I'll check it out.
Re: Logging and tracing in D
Am 06.08.2013 19:22, schrieb Andre Artus: > -- snip-- >> and you get pretty formatted message in console(add log file writer if >> needed), and you get "smart" logging for free, in that way it will be >> generated only for debug mode(in release it will be skipped because of >> debug specifier). > > Thanks, can I take it that there is no official library for this kind of > thing then? I would think it generally useful. Perhaps it can be > considered for inclusion into Phobos. There is std.log (proposed), it doesn't work, I don't like its API. I wrote my own logger (consider it MIT licensed) https://github.com/Dav1dde/BraLa/blob/master/brala/utils/log.d I am not 100% happy how it turned out, but I haven't come around to change it, but it works pretty well.
Re: Logging and tracing in D
On Tue, Aug 06, 2013 at 07:22:11PM +0200, Andre Artus wrote: > -- snip-- > >and you get pretty formatted message in console(add log file > >writer if needed), and you get "smart" logging for free, in that > >way it will be generated only for debug mode(in release it will be > >skipped because of debug specifier). > > Thanks, can I take it that there is no official library for this > kind of thing then? I would think it generally useful. Perhaps it > can be considered for inclusion into Phobos. This is strange. I clearly remember some time ago that there was a logging module in the Phobos review queue. But after the initial feedback, I haven't heard anything from it since. What's going on? Has it been abandoned? T -- Those who've learned LaTeX swear by it. Those who are learning LaTeX swear at it. -- Pete Bleackley
Re: Logging and tracing in D
-- snip-- and you get pretty formatted message in console(add log file writer if needed), and you get "smart" logging for free, in that way it will be generated only for debug mode(in release it will be skipped because of debug specifier). Thanks, can I take it that there is no official library for this kind of thing then? I would think it generally useful. Perhaps it can be considered for inclusion into Phobos.
Re: Logging and tracing in D
On Tuesday, 6 August 2013 at 04:35:39 UTC, Andre Artus wrote: What is the recommended approach for adding logging and tracing to D apps? Is there a library for it? custom very simple yet powerful logging can be achieved with templates and debug specifier, something like this: module logger; import std.datetime; import std.stdio : writefln; template log(T) { auto timeString = Clock.currTime().toISOExtString(); writefln("log message from(%s)[+%s]: %s", __FUNCTION__, timeString, T); } then in ur code just place with debug specifier: import logger; void main { debug log!"my stuff"; } and you get pretty formatted message in console(add log file writer if needed), and you get "smart" logging for free, in that way it will be generated only for debug mode(in release it will be skipped because of debug specifier).
Logging and tracing in D
What is the recommended approach for adding logging and tracing to D apps? Is there a library for it?