marcelog / Nami

Asterisk manager interface (ami) client for nodejs
http://marcelog.github.com/Nami
Apache License 2.0
99 stars 59 forks source link

How to disable debug logging #41

Closed darksaboteur closed 8 years ago

darksaboteur commented 8 years ago

When using the library there are get many debug log events printed to the console like the following: [2016-02-26 11:47:56.036] [DEBUG] Nami.Client - Got event: Event { ..... [2016-02-26 11:47:56.036] [DEBUG] Nami.Client - Skipped 0 bytes

repeated thousands of times.

How do are these disabled?

marcelog commented 8 years ago

Hello,

Nami uses log4js, you should check their doc: https://github.com/nomiddlename/log4js-node

The AsterTrace-Node project has also an example for setting this up: https://github.com/marcelog/AsterTrace-Node/blob/master/conf/logger.json.example

Best!

NicolasCharpentier commented 8 years ago

Hi,

Was also looking for this.

You can use the null object pattern.

var nami = new (namiLib.Nami)(namiConfObject);

nami.logger = { debug: function () {} };