System logging

11 views
Skip to first unread message

Russell Weir

unread,
May 28, 2008, 2:03:40 AM5/28/08
to caffe...@googlegroups.com
I've just added to /ext/system/log
EventLog.hx : The Interface for system logging
File.hx : Neko (Php & Lua?) file output logging
Syslog.hx : Interface to syslog (linux/freebsd/Mac, need help with
windows on this one)

I would like to have a unified approach to logging for haxe, since
"trace" has caused many problems for me in the past, including
blocking Flash9 events (don't ask me how, but it did!)

It would be nice to add targets for flash and JS as well, with the
possibility of rerouting "trace" automatically, and optionally
redirecting to Firebug (which I use all the time)

Please feel free to contribute there. The File and Syslog work
perfectly right now on my machine. Anyone know what Windows has for a
command line to the system event log?


R

Franco Ponticelli

unread,
May 28, 2008, 5:34:33 AM5/28/08
to caffe...@googlegroups.com
On Wed, May 28, 2008 at 7:03 AM, Russell Weir <damon...@gmail.com> wrote:

I've just added to /ext/system/log
EventLog.hx : The Interface for system logging
File.hx : Neko (Php & Lua?) file output logging
Syslog.hx : Interface to syslog (linux/freebsd/Mac, need help with
windows on this one)
I would like to have a unified approach to logging for haxe, since
"trace" has caused many problems for me in the past, including
blocking Flash9 events (don't ask me how, but it did!)

What about makin LogLvl optional in both the constructor and the log function? We could set two default values for them (Warning),  so their accessability could be easier for fast debugging.
 
Franco

Russell Weir

unread,
May 28, 2008, 7:11:23 AM5/28/08
to caffe...@googlegroups.com
Could do that.. I'd mad the log() function internal, forcing the user
to use logger.info() etc, but the syntax

var l = new system.log.Syslog()
l.log("whatever")

Defaulting to the warning level? That's what you're saying... then
l.debug() would not trace anything, unless you specifically modify the
logLevel.

Russell

Franco Ponticelli

unread,
May 28, 2008, 7:15:42 AM5/28/08
to caffe...@googlegroups.com
Defaulting to the warning level? That's what you're saying... then
l.debug() would not trace anything, unless you specifically modify the
logLevel.

Why not?



var l = new system.log.Syslog()
l.log("whatever")

is equivalent to:

var l = new system.log.Syslog("service", WARN);
l.log("whatever", WARN)

Reply all
Reply to author
Forward
0 new messages