This repository has been archived by the owner. It is now read-only.

buster.log prints "undefined" for functions #94

Closed
augustl opened this Issue Feb 21, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@augustl
Member

augustl commented Feb 21, 2012

        buster.log(typeof function () {});
        // function
        buster.log(function () {});
        // undefined
@cjohansen

This comment has been minimized.

Member

cjohansen commented Feb 21, 2012

Riiiight... Turns out this is by design (but still wrong). Thing is, the evented logger runs the function. The way this works is that you can give it a function that will only be evaluated if the message will be logged. So, if you do logger.warn(function () { /* expensive operation */ }); and your log level is set to error, then the function won't be called.

However, for buster.log, which is a debugging tool, this doesn't make sense. I'll look into it.

@ghost ghost assigned cjohansen Feb 21, 2012

@cjohansen

This comment has been minimized.

Member

cjohansen commented Feb 21, 2012

Yay. Solved. buster 0.4.5 out.

@cjohansen cjohansen closed this Feb 21, 2012

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.