• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

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

Scheduled Pinned Locked Moved System
3 Posts 2 Posters 1.3k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    shbatm Module Developer
    last edited by shbatm Jan 7, 2019, 7:31 PM Dec 5, 2018, 6:59 PM

    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 <log> Initializing new module helper ... (js/app.js:128 loadModule)
    0|mm  | 2018-12-05T12:42:51 <log> Module helper loaded: MMM-Logging (js/app.js:161 loadNextModule)
    0|mm  | 2018-12-05T12:42:51 <log> No helper found for module: alert. (js/app.js:163 )
    

    Download:

    [card:shbatm/MMM-Logging]


    Current Version: 1.0.1 – CHANGELOG

    1 Reply Last reply Reply Quote 4
    • R Offline
      retroflex Project Sponsor Module Developer
      last edited by Dec 7, 2018, 8:23 PM

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

      1 Reply Last reply Reply Quote 0
      • S Offline
        shbatm Module Developer
        last edited by Jan 7, 2019, 7:30 PM

        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.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy