Commit Graph

22 Commits

Author SHA1 Message Date
Andrew Stewart 843e0a3217 Simplify logger
This commit adds a simplified logging system, with two primary methods:

- `Logger#log(String) :: void` (for normal logging)
- `Logger#debug(String) :: void` (for debug logging)

This helps dramatically simplify logging infrastructure, as well as
enabling simpler toggling of log modes.

The configuration values for the Logger have also been updated:

- `logger :: Function` - function to log output to (both normal + debug)
- `silent :: Boolean` - whether to log default normal messages or not (`--silent` flag)
- `debug  :: Boolean` - whether or not to log debug output (`--debug` flag)

Additionally, the following CLI flags are supported re: logging:

- `--silent` disables normal logging (will override all other settings)
- `--debug` enables debug logging

Deprecation notices have been added for old log methods, with first-run
messages to this effect.

This change should have negligible impact on end-users, with minor
inconvenience for library developers, as they need to switch their
logging function calls over.

Logging configuration is still possible via both
`Cylon.Config.update(Object)`, and directly calling
`Cylon.Logger.setup(Object)`.
2015-07-13 14:05:12 -07:00
Andrew Stewart b1c91b7419 Logger should subscribe to updates, not be told what to do 2015-06-22 19:08:15 -07:00
Andrew Stewart 0b48851885 Remove unnecessary comments at start of files 2015-06-22 09:16:43 -07:00
Andrew Stewart 62cbae7cff Switch to ESLint for linting 2015-04-15 08:59:34 -07:00
Andrew Stewart cccb376679 Consistent top-of-file doc blocks 2015-04-15 08:59:12 -07:00
Andrew Stewart 2ed5fcf64e Add CLI flag for enabling debug logging 2015-03-22 17:07:25 -07:00
Andrew Stewart 6e3d7c6667 Add helpers to replace some lodash functionality
Not a 1:1, and probably much slower than Lodash's ultra-optimised
implementations, but we do enough I/O that it's not really relevant,
is it?
2015-02-23 08:38:12 -08:00
Andrew Stewart 618aa8212d Remove lodash 2015-02-20 11:15:34 -08:00
Andrew Stewart 4b377b2e65 Streamline Logger a bit 2015-01-13 10:43:20 -08:00
Andrew Stewart eccdde81a9 Update copyright years 2015-01-07 12:58:50 -08:00
Andrew Stewart ac6b09fe50 Clean up lib for JSHint 2014-12-15 11:15:29 -08:00
Andrew Stewart 4f850d5e9e Support passing config to Logger#setup again 2014-11-28 09:37:44 -08:00
Andrew Stewart c43978bea2 Add logging for module registration 2014-11-05 14:26:18 -08:00
Andrew Stewart 0f59645fd7 Move Logger configuration into Cylon#config 2014-10-28 15:53:03 -07:00
Andrew Stewart 2cb2fc232d Basic log level implementation 2014-10-27 08:59:36 -07:00
Andrew Stewart d65742bb49 Generate code! It's what the cool kids are doing! 2014-10-24 14:54:56 -07:00
Andrew Stewart f5de644af7 Not sure why these were classes to begin with 2014-10-24 14:02:03 -07:00
Andrew Stewart c22ef95239 Remove Logger from global namespace 2014-05-13 19:44:40 -07:00
Andrew Stewart 1e44224660 Refactor Logger 2014-05-13 19:05:01 -07:00
Andrew Stewart c0c4ce6958 Small changes to appease JSHint 2014-03-07 23:33:59 -08:00
Andrew Stewart 599a5bb288 Refactor logger.js 2014-02-27 13:32:05 -08:00
deadprogram b27756abfc WIP on pure JS revamp 2014-02-27 06:44:53 -08:00