Hey there guys, new to sails here, so far it looks great and I'm loving it.
There is one thing that giving me trouble though. It seems to me that the log priority for levels info and debug are backwards. In the
docs debug has a lower priority than info but in
this issue it's stated that Sails follows NPM's logging conventions referencing
npmlog's documentation. Also, Sails docs mention using Winston as custom logger which is great but also disagree with Sails on the priorities as you can see
here.
In the end, this are the logging priorities.
NPM: { error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5 }
Syslog: { emerg: 0, alert: 1, crit: 2, error: 3, warning: 4, notice: 5, info: 6, debug: 7 }
{ error: 0, warn: 1, http: 2, info: 3, verbose: 4, silly: 5 }
{ error: 0, warn: 1, info: 2, logs: 3, debug: 4 }
{ off: 0, error: 1, warn: 2, info: 3, debug: 4 }
{ silent: 0, error: 1, warn: 2, debug: 3, info: 4, verbose: 5, silly: 5 }
As you can see, most except for Sails agree that info is closer to warn than debug. So my questions:
1- Does Sails actually have the log priorities/levels different than the rest of the world?
2- If it does, should we change it to match the rest of the world?
3- Is it possible to change those priorities just for my app in the config without causing havok on the rest of the framework ?
Why is this order important ?. Well it turns out that, like most, I use third party libraries in my applications. Some of this third party libraries accept a log object as parameter to be used instead of just using console.log. And it's here where it becomes obvious that the log priorities of these libraries are different than Sail's.
Thanks a lot for your time.
Cheers.