guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error reporting


From: Sebastian Tennant
Subject: Re: Error reporting
Date: Wed, 26 Nov 2008 17:16:33 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Thanks for the suggestions guys.

I was already using soft output ports for writing controlled debugging
information to log files, and it never occurred to me to simply add:

 (set-current-error-port <macro-returning-port-to-/usr/bin/logger>)

to the top of my scripts!

Incidentally, I've written a module that wraps /usr/bin/logger and a
couple of macros that make defining any number of log functions a snip.

Example usage:

 In cgi/my-script.scm...

 (use-modules (sebyte glog))
 (load "lib/loggers.scm")         ;prepare log functions (names, log
                                  ;files, priorities, port tags, padding)

 (quick-loggers "my-script.scm")  ;define log functions with entry tag
                                  ;'my-script.scm'

 (info "foo")                     ;write to log file at priority info
 (alert "bar")                    ;write to log file at priority alert
 .
 .
 .
 
 Later on, in cgi/sub-script.scm...

 (quick-loggers "sub-script.scm") ;redefine log functions with entry tag
                                  ;'sub-script.scm'
 .
 .
 .


Is this the sort of thing that might go down well on guile.sources?

Seb





reply via email to

[Prev in Thread] Current Thread [Next in Thread]