digitalmars.D.learn - Logging and tracing in D
- Andre Artus (3/3) Aug 05 2013 What is the recommended approach for adding logging and tracing
- evilrat (24/27) Aug 06 2013 custom very simple yet powerful logging can be achieved with
- Andre Artus (4/8) Aug 06 2013 Thanks, can I take it that there is no official library for this
- David (6/15) Aug 06 2013 There is std.log (proposed), it doesn't work, I don't like its API.
- Andre Artus (3/27) Aug 06 2013 Cool, thanks, I'll check it out.
- David (3/19) Aug 06 2013 It's currently in the review queue: http://wiki.dlang.org/Review_Queue
- Andre Artus (2/8) Aug 06 2013 Thanks, I'll check it out later.
- Jesse Phillips (2/7) Aug 06 2013 http://wiki.dlang.org/Review_Queue
- H. S. Teoh (6/22) Aug 06 2013 [...]
- H. S. Teoh (8/17) Aug 06 2013 This is strange. I clearly remember some time ago that there was a
- Jacob Carlborg (7/9) Aug 07 2013 Tango contains a package for logging:
What is the recommended approach for adding logging and tracing to D apps? Is there a library for it?
Aug 05 2013
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).
Aug 06 2013
-- 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.
Aug 06 2013
Am 06.08.2013 19:22, schrieb Andre Artus:-- snip--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.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.
Aug 06 2013
David wrote: Am 06.08.2013 19:22, schrieb Andre Artus:I take it that it hasn't been documented yet, at least I could not find it on dlang.org.-- snip--There is std.log (proposed), it doesn't work, I don't like its API.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.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.
Aug 06 2013
Am 06.08.2013 20:54, schrieb Andre Artus:It's currently in the review queue: http://wiki.dlang.org/Review_Queue but marked on hold/suspended.David wrote: Am 06.08.2013 19:22, schrieb Andre Artus:I take it that it hasn't been documented yet, at least I could not find it on dlang.org.-- snip--There is std.log (proposed), it doesn't work, I don't like its API.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.
Aug 06 2013
-- snip --Thanks, I'll check it out later.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.
Aug 06 2013
On Tuesday, 6 August 2013 at 18:54:50 UTC, Andre Artus wrote:http://wiki.dlang.org/Review_QueueDavid 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.
Aug 06 2013
On Tue, Aug 06, 2013 at 08:54:48PM +0200, Andre Artus wrote:[...] Sounds like it's not merged into the official codebase yet. T -- Always remember that you are unique. Just like everybody else. -- despair.comDavid wrote: Am 06.08.2013 19:22, schrieb Andre Artus:I take it that it hasn't been documented yet, at least I could not find it on dlang.org.-- snip--There is std.log (proposed), it doesn't work, I don't like its API.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.
Aug 06 2013
On Tue, Aug 06, 2013 at 07:22:11PM +0200, Andre Artus wrote:-- snip--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 Bleackleyand 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.
Aug 06 2013
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
Aug 07 2013