Skip to content

Change the way logging is done #55

@satazor

Description

@satazor

At the moment, logging is done via the context. To increase compatibility with the upcoming node-task, logging could be done via an emitter like so:

this.emitter.emit('log', 'hello');
this.emitter.emit('log.info', 'hello info');
this.emitter.emit('log.warn', 'hello warn');
this.emitter.emit('log.success', 'hello success');
this.emitter.emit('log.error', 'hello error');
this.emitter.emit('log.debug', 'hello debug');

Question: Should we remove the ln versions or do it like this:

this.emitter.emit('logln', 'hello');
this.emitter.emit('logln.info', 'hello info');
this.emitter.emit('logln.warn', 'hello warn');
this.emitter.emit('logln.success', 'hello success');
this.emitter.emit('logln.error', 'hello error');
this.emitter.emit('logln.debug', 'hello debug');

Please note that, the context parameter could be removed completely. Functions would only receive opts and next.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/107105-change-the-way-logging-is-done?utm_campaign=plugin&utm_content=tracker%2F39683&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F39683&utm_medium=issues&utm_source=github).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions