Skip to content

Prefix with package.json name #3

@3rd-Eden

Description

@3rd-Eden

When you are logging from multiple modules, it can be quite annoying to figure out where a certain log is coming from. Especially if the filename is the same everywhere:

2013-10-31 10:10:23 info:     (index.js/end/EventEmitter.emit) The cmd connection has closed
2013-10-31 10:10:23 info:     (index.js/reconnecting/EventEmitter.emit) The cmd connection is reconnecting { delay: 255, attempt: 2 }
2013-10-31 10:10:24 debug:    (index.js/connect/EventEmitter.emit) The cmd connection has conneccted
2013-10-31 10:10:24 debug:    (index.js/ready/EventEmitter.emit) The cmd connection is ready
2013-10-31 10:13:25 info:     (index.js/end/EventEmitter.emit) The cmd connection has closed
2013-10-31 10:13:25 info:     (index.js/reconnecting/EventEmitter.emit) The cmd connection is reconnecting { delay: 255, attempt: 2 }
2013-10-31 10:13:26 debug:    (index.js/connect/EventEmitter.emit) The cmd connection has conneccted
2013-10-31 10:13:27 debug:    (index.js/ready/EventEmitter.emit) The cmd connection is ready
2013-10-31 10:16:27 info:     (index.js/end/EventEmitter.emit) The cmd connection has closed
2013-10-31 10:16:27 info:     (index.js/reconnecting/EventEmitter.emit) The cmd connection is reconnecting { delay: 255, attempt: 2 }
2013-10-31 10:16:28 debug:    (index.js/connect/EventEmitter.emit) The cmd connection has conneccted
2013-10-31 10:16:29 debug:    (index.js/ready/EventEmitter.emit) The cmd connection is ready
2013-10-31 10:19:30 info:     (index.js/end/EventEmitter.emit) The cmd connection has closed
2013-10-31 10:19:30 info:     (index.js/reconnecting/EventEmitter.emit) The cmd connection is reconnecting { delay: 255, attempt: 2 }
2013-10-31 10:19:31 debug:    (index.js/connect/EventEmitter.emit) The cmd connection has conneccted
2013-10-31 10:19:32 debug:    (index.js/ready/EventEmitter.emit) The cmd connection is ready
2013-10-31 10:22:32 info:     (index.js/end/EventEmitter.emit) The cmd connection has closed
2013-10-31 10:22:32 info:     (index.js/reconnecting/EventEmitter.emit) The cmd connection is reconnecting { delay: 255, attempt: 2 }
2013-10-31 10:22:33 debug:    (index.js/connect/EventEmitter.emit) The cmd connection has conneccted
2013-10-31 10:22:34 debug:    (index.js/ready/EventEmitter.emit) The cmd connection is ready

In the case above, you still have no idea where the log message is coming from. Having the project name would be super helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions