Open kylemac opened 9 years ago
@kylemac I may not be thinking straight on this, but utils.log.queue
doesn't really work as a Utils
instance doesn't really know when a function ends, right?
I like the idea of a logger, though. Maybe with utils.log.success
, utils.log.error
, and utils.log.message
?
@kylemac :point_up:
major slowness here - apologies.
yeah you're right - because utils
is completely detached we can't accomplish the queueing in a good way. it's a "nice to have" feature, but not worth refactoring or marshaling an object across the classes. i do like your proposal for the logging utils though.
@kylemac Thinking about this again! Do you think we should tie this into the existing emitter?
i'm sort of on the side of things that thinks it's not worth the effort right meow
https://github.com/bevry/caterpillar may be of use
i've run into a few different log uses cases and i feel like a simple console.log falls a little short. i'm thinking we implement these logging helpers:
utils.log.write
- a simple wrapper around console.log but with colored outpututils.log.queue
- a buffer of logged messages (probably displayed in a list) that logged only after the compilation is complete. think of these like post-install instructions. a use-case i've had is leaving a few different post-install messages like "don't forget to edit the keys in coveralls.yml" and "go to http://magnum.travis-ci.com to obtain your API key".