os-threat / Stix-ORM

GNU Affero General Public License v3.0
4 stars 0 forks source link

logging vs loguru #2

Open priamai opened 1 year ago

priamai commented 1 year ago

We should decide to move everything to logging or loguru, having both causes confusion.

brettforbes commented 1 year ago

personally, i like haveing the blue loguru statements for the loading of data from the directories, this is its only use case, and personally i dont see the issue of having it do that job, once again imho

priamai commented 1 year ago

I like the logoru style, but we have to test whether we can control the verbosity level for all modules from one point, @dfjosullivan any other comments?

priamai commented 1 year ago

find a way to manage the logging levels for each module individually via a config file of some sort...

priamai commented 1 year ago

@andrewgin we need to find a way to configure -centrally- the logging levels for each module in the entire codebase. Ideally this could be like a yaml/json file where the user setup the levels for each module. Let me know if you have any experience with that. We prefer to use Loguru because it has a nice syntax highlight.

brettforbes commented 1 year ago

I dont mind using the logging system we currently use. I have most files set to INFO, and only set them to DEBUG when I want to see what is happening in that file. There is way to much logging to handle a global setting for all files.

Also, currently when all logging is set to INFO, then some stuff still logs, basically the loading of the protocol objects (in blue), the loading of the four marking objects, and then the query string and returned concept map for each record being loaded. This is super useful (from my opinion) but may not be wanted by others. Perhaps we need a way to turn this verbosity down, firstly collapsing the concept maps, and then removing everything. I am not sure how hard this is, but if the middle setting is too hard, then an off switch for all logging is the fallback.

Also 2, I know it is unimportant, but the logging used in the init() files in the dictionary module looks cool when it comes out blue.

Can we either:

  1. Leave loguru just for this application, or
  2. Get the standard logging to print blue just for this application