MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

[MMM-Logging] Module for better Node.js console logging with Timestamps and Function Calls


  • Module Developer

    Description:

    This is a simple module which extends the Node.js console logging capabilities of the MagicMirror² project through implementation of the tracer Node.js module, including adding timestamps, call sources, and stack traces.

    By default, this module will intercept and format ALL console log messages from the MagicMirror instance once it is loaded so no additional changes need to be made to individual modules. If they log output using the standard console.log() or console.error() they will be reformatted and pretty printed.

    Examples:

    Before MMM-Logging:

    0|mm  | Starting MagicMirror: v2.6.0-dev
    0|mm  | Loading config ...
    0|mm  | Loading module helpers ...
    0|mm  | Initializing new module helper ...
    0|mm  | Module helper loaded: MMM-Logging
    0|mm  | No helper found for module: alert.
    

    After MMM-Logging:

    0|mm  | Starting MagicMirror: v2.6.0-dev
    0|mm  | Loading config ...
    0|mm  | Loading module helpers ...
    0|mm  | 2018-12-05T12:42:51  Initializing new module helper ... (js/app.js:128 loadModule)
    0|mm  | 2018-12-05T12:42:51  Module helper loaded: MMM-Logging (js/app.js:161 loadNextModule)
    0|mm  | 2018-12-05T12:42:51  No helper found for module: alert. (js/app.js:163 )
    

    Download:


    Current Version: 1.0.1 – CHANGELOG


  • Project Sponsor Module Developer

    Amazing! I have missed time stamps a lot when debugging. And now we get file and line nr too. Great work!


  • Module Developer

    Updated to version [1.0.1] - now includes browser methods for formatting the DevTools console (disabled by default) and ability to echo Module Notifications and Errors from the web browser back to the Node (back-end) console and logs.


Log in to reply