zwave-js / node-red-contrib-zwave-js

The most powerful, high performing and highly polished Z-Wave node for Node-RED based on Z-Wave JS. If you want a fully featured Z-Wave framework in your Node-RED instance, you have found it.
MIT License
47 stars 6 forks source link

Log level sorting #62

Closed crxporter closed 3 years ago

crxporter commented 3 years ago

Version 3.7.1

This list is clearly in alphabetical order - can it be moved to order of "how many logs"? So I think on a scale from "Error" to "Silly"... I would put "Error" (fewest logs?) on top and "Silly" (most logs) on the bottom.

image
crxporter commented 3 years ago

Let's see if I get it right?

1- Error (fewest logs) 2- Warn 3- Info 4- Verbose 5- Debug 6- Silly (most logs)

marcus-j-davies commented 3 years ago

Hey!

Once upon a time, it was ordered by the numerical value (which you listed ) https://github.com/winstonjs/winston#logging-levels

This was changed, to use the string values (z-wave JS, internally converts). I had a mental tick, about not having order (visually or in code)

Log level http is not used in Z-Wave JS

was

<option value="0">Error</option>
<option value="1">Warn</option>
<option value="2">Info</option>
<option value="4">Verbose</option>
<option value="5">Debug</option>
<option value="6">Silly</option>

Now

<option value="debug">Debug</option>
<option value="error">Error</option>
<option value="info">Info</option>
<option value="silly">Silly</option>
<option value="verbose">Verbose</option>
<option value="warn">Warn</option>

I do agree however, its normal practice, to have the order based on Logging level, as apposed to someone's tick 😆

crxporter commented 3 years ago

I have no issue with the debug level names ... I was mostly referring to the specific drop down menu ... it would be nice to have it in order so I can be like "I want one level more or less" and just pick the one above or below the current set ...

marcus-j-davies commented 3 years ago

Yup.

it was in order (of log severity ) when I was using integers for the backend value, when I switched to using the strings for the backend, I switched to showing it alphabetically (due to my own quirks)

I'll get it changed - as I do agree

crxporter commented 3 years ago

Ah. I understand now. Carry on!

marcus-j-davies commented 3 years ago

for 3.8.0 (next release)