JSPM

log-with-namespace-and-date-stamp

1.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 4
    • Score
      100M100P100Q38772F
    • License MIT

    A simple log function with namespace and date-stamp

    Package Exports

    • log-with-namespace-and-date-stamp

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (log-with-namespace-and-date-stamp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    A Simple Log Function with Namespace and Date Stamp

    This is a simple log module that write log messages with a date-stamp and a name-space to the standard output (or a specified writable stream, pass it in as the second argument to the generateLogger function).

    It is quick and dirty and not optimized for performance.

    var generateLogger = require('log-with-namespace-and-date-stamp')
    var log = generateLogger('namespace')
    
    log('my message')
    // -> 2015-02-02 11:35 [namespace] my message

    If the last argument is an array the content will be printet in params after the name-space.

    var generateLogger = require('log-with-namespace-and-date-stamp')
    var log = generateLogger('namespace')
    
    log('my message', ['foo', 'bar'])
    // -> 2015-02-02 11:35 [namespace] (foo, bar) my message

    That is all.

    License

    MIT