Skip to content

Conversation

@gsandie
Copy link
Contributor

@gsandie gsandie commented Nov 10, 2011

I like the timer logs, however I'd love to be able to have different ones emitted at different levels. e.g. setup some DEBUG timers that I wouldn't normally want to know about.

This pull request isn't really ready to merge, but I wanted to discuss what I was trying to achieve :)

I've added the current log level into the timer log.

I'm not sure of the best way to proceed. I was thinking of sometime like:

logger.time("some_message", "level") { do_stuff }

And default the "level" to be :info.

But I can't work out how to call into the logger mixin so that I could check if the level matches the level we are logging at.

What do you think?

@jordansissel
Copy link
Owner

Great idea, though not sure what the API should look like - I'm totally open to any ideas here. In the meantime, I"ll give it a ponder over the weekend.

@jordansissel
Copy link
Owner

If the log level stuff is generalized, it might be easier to hack in conditional time logging... hmm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants