Can log4js have a custom log function? #146

XadillaX opened this Issue Jul 19, 2013 · 5 comments



TODO in Version 2.x

2 participants

You see, there're trace, debug, info, warn, error and fetal.

But if I want custom a new message type and color, how should I do?

for example, I want have a "success" with green color or I want have a "foo" with bar color.


nomiddlename commented Jul 19, 2013

The pattern layout may be of use to you, if you want to format log messages. But you would still have to use the standard log functions.

Emmm, I mean that,

maybe, in next version, will it have some function like:

logger.addLevel(level, color);
logger.customlevel(level, msg);


nomiddlename commented Jul 19, 2013

I see what you mean. User-defined log levels could be possible. I'm happy to accept pull requests for this if anyone feels like implementing it, otherwise I'll add it to the list of things for me to do.

Thx~ And if possible, i will try to if my ability allows


nomiddlename commented Mar 27, 2017

This is another version of #254 - a feature I'll add in version 2.x

nomiddlename added this to the 2.x milestone Mar 27, 2017

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