Control verbosity level via configuration option

Issue #538 resolved
Desrever Nu created an issue

I propose we rename the verbose parameter : verbosity.

Instead of boolean it should be String and accept the following values :

high : ( log.level >= debug )

normal : ( log.level >= info )

low : ( log.level >= warning )

We can then make more sophisticated changes and hide the complexity between these three pre-defined levels

Comments (22)

  1. Desrever Nu reporter

    The change will affect the files stored on filesystem too : We will keep the two files as before but they will contain the following :

    verbosity = high . Standard file level : debug , Verbose file level : debug (the two files are identical)

    verbosity = normal . Standard file level : info , Verbose file level : debug

    verbosity = low . Standard file level : warn , Verbose file level : debug

  2. Benjamin Cordes

    basically we apply the same filter for only the standard logfile filter? what about HTML?

    wondering if the distinction into these separate files still make sense..

  3. Benjamin Cordes

    another question while we're on the topic: the logfile loggers, don't use level? don't recall whether that was intentional or not.

  4. Desrever Nu reporter

    what about HTML?

    In my prev comment I meant that the same applies for html and .log without distinction

    the logfile loggers, don't use level? on't recall whether that was intentional or not.

    It was intentional as the log file (standard) would be used in the GUI. We can add it back if you think it is necessary

  5. Desrever Nu reporter

    I am testing it now : Running the Bot with verbosity "low" : - stdOUT ok

    • the standard.log|html still contains log.info level messages . It shouldn't

    • Another issue : for tests, I imagine they should always use the other xml. However for some reason I now ran TestWrappers.java and the stdout was set to warn. It should be always set to debug for tests

  6. Benjamin Cordes

    "However for some reason I now ran TestWrappers.java and the stdout was set to warn. It should be always set to debug for tests" => don't follow. Test uses test_logback.xml

  7. Benjamin Cordes

    the mentioned issues are solved (except TestWrappers). perhaps you can cross-check if you have time.

  8. Desrever Nu reporter

    stdOUT is OK in all modes.

    Files still have 6 issues marked below.

    • Verbosity : "normal" - verbose.log and .html file doesn't show debug messages [*1]

    • Verbosity : "high" - standard.log [2]and .html [3] doesn't show debug messages ;

    • Verbosity : "low" - standard.html shows infos (it should not, like in standard.log )[4] ; verbose.log [4] and .html [*6] only shows warnings and errors

    Please refer to my previous message on the correct file content.

    verbosity = high . Standard file level : debug , Verbose file level : debug (the two files are identical)

    verbosity = normal . Standard file level : info , Verbose file level : debug

    verbosity = low . Standard file level : warn , Verbose file level : debug

    TestWrappers, on the contrary, seems to be fixed. However the other Tests (e.g TestPriceFeeds) still gives no correct output [*7].

  9. Benjamin Cordes

    ok fixed. there where additional level filters. in verbose this filter will still be used to stop Trace messages.

    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
    <level>DEBUG</level>
    </filter>
    
  10. Benjamin Cordes

    Fixed and tested. Issue 7 happens because options is not defined and filtering does not happen. Suggestion is to remove the line if (Global.options)

  11. Benjamin Cordes

    We haven't specified what UI will use in the cases. I suggest it will use verbose if it's high, otherwise the standard file, i.e.

    if (Global.options.verbosity.equalsIgnoreCase(Settings.LEVEL_HIGH)){
                    f = verboselogfile;
    }
    
  12. Desrever Nu reporter

    no.

    Result issues from tests on develop

    • Verbosity : "low" - standard.html shows infos (it should not, like in standard.log )[1] ; verbose.log [2] only shows warnings and errors

    • Verbosity : "normal" - verbose.log only shows infos (not debug) [3]

    • Verbosity : "high" - standard.html[4] and .log[5] only shows infos (not debug)

    TestWrappers follows level of verbosity of the config [6]

    TestPriceFeed is blank [7]

    We haven't specified what UI will use in the cases. I suggest it will use verbose if it's high, otherwise the standard file, i.e.

    OK

    Please before submitting for test again make sure issues 1 to 7 do not appear anymore

  13. Benjamin Cordes

    ok, my bad - the changes were only in test_logback not logback.xml. I adjusted logback.xml and am testing with mainlaunch also.

  14. Benjamin Cordes

    done. Note: before options is set logs of all levels go through. we start filtering once Global.verbosity is defined.

  15. Log in to comment