Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

central logger #173

Closed
chris-rock opened this issue Nov 15, 2013 · 10 comments
Closed

central logger #173

chris-rock opened this issue Nov 15, 2013 · 10 comments

Comments

@chris-rock
Copy link
Member

For debugging and development it would be great do get more debug messages during runtime.

We should start thinking about using a proper logger. I propose we are going with https://github.com/flatiron/winston. Does that fit with everyone?

@lloydwatkin
Copy link
Member

Yeah, just implemented this for xmpp-ftw so happy to use that.

@soyuka
Copy link

soyuka commented Dec 3, 2013

+1 but winstonjs/winston#294 looks dead, you could try https://github.com/bevry/caterpillar should be better ;).

@imaginator
Copy link

If this is running on a server, using a logger with syslog support is
always nice.

https://npmjs.org/browse/keyword/syslog

@lloydwatkin
Copy link
Member

Looks like the 'pretty much' implement the same API, e.g.

logger.log('level', 'log message')

They don't seem to have *.debug(), *.info(), *.error(), but that's something I can raise an issue for (done).

@soyuka
Copy link

soyuka commented Dec 3, 2013

Hmm, it should be pretty easy to extend, I just tried with underscore and it looks like this (could be improved ofc) :

    var myLogger = _.extend(logger, {
        debug : function() {
            var args = Array.prototype.slice.call(arguments);
            args.unshift("debug");
            return this.log.apply(this, args);
        },

    })

@lloydwatkin
Copy link
Member

Yes, but it would be nicer not to have to extend :)
If (and I presume it will) winston starts pushing and innovating again users might want to switch back. winston also has a (relatively) large user base so cutting off those users would be a fail in my eyes. Thoughts welcome, especially as we haven't started this work yet.

@chris-rock
Copy link
Member Author

I highly recommend winston. In case we should support syslog, we should implement this as a winston plugin. I think we should not start from scratch here.

@lloydwatkin
Copy link
Member

Agreed
On 3 Dec 2013 14:46, "Chris" notifications@github.com wrote:

I highly recommend winston. In case we should support syslog, we should
implement this as a winston plugin. I think we should not start from
scratch here.


Reply to this email directly or view it on GitHubhttps://github.com//issues/173#issuecomment-29714945
.

@imaginator
Copy link

Sounds good. https://github.com/indexzero/winston-syslog is already implemented too!

@chris-rock
Copy link
Member Author

We decided to use debug as a module. Winston would be a big dependency. Debug is smaller an do not force any user of node-xmpp to use a specific logging lib. We intreduced this in some parts already. See node-xmpp/node-xmpp-core/pull/21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants