1414# Imported to make webwidget addons work
1515from Orange .widgets .utils .webview import WebviewWidget # pylint: disable=unused-import
1616
17+ LOG_LEVELS = [
18+ logging .CRITICAL + 10 ,
19+ logging .CRITICAL ,
20+ logging .ERROR ,
21+ logging .WARN ,
22+ logging .INFO ,
23+ logging .DEBUG
24+ ]
1725
1826def main (argv = None ):
1927 app = QApplication (list (argv ) if argv else [])
@@ -28,13 +36,13 @@ def main(argv=None):
2836 )
2937 )
3038 parser .add_argument ("--log-level" , "-l" , metavar = "LEVEL" , type = int ,
31- default = logging . CRITICAL , dest = "log_level" )
39+ default = 3 , dest = "log_level" )
3240 parser .add_argument ("--config" , default = "Orange.canvas.config.Config" ,
3341 type = str )
3442 parser .add_argument ("file" )
3543 args = parser .parse_args (argv [1 :])
3644
37- log_level = args .log_level
45+ log_level = LOG_LEVELS [ args .log_level ]
3846 filename = args .file
3947 logging .basicConfig (level = log_level )
4048
@@ -71,6 +79,9 @@ def on_finished():
7179 if msg .contents and msg .severity == msg .Error :
7280 print (msg .contents , msg .message_id , file = sys .stderr )
7381 severity = msg .Error
82+ elif msg .contents and msg .severity == msg .Warning and \
83+ log_level <= logging .WARNING :
84+ print (msg .contents , file = sys .stderr )
7485 if severity == UserMessage .Error :
7586 app .exit (1 )
7687 else :
0 commit comments