File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
import platform
3
3
import re
4
+ import sys
4
5
import threading
5
6
import time
6
7
import tkinter as tk
14
15
from Bot import config as cfg
15
16
from Bot import functions as fe
16
17
17
- log_level = "TRACE"
18
- log_format = "[{time}] [{level}] {name}:{function}:{line} - {message}"
18
+ config = cfg .ConfigHandler ("config.properties" ) # type: ignore
19
+
20
+ log_level = config .get_log_level ()
19
21
logger .add (
20
22
"client.log" ,
21
23
level = log_level ,
22
- format = log_format ,
24
+ format = "[{time}] [{level}] {name}:{function}:{line} - {message}" ,
23
25
colorize = False ,
24
26
backtrace = True ,
25
27
diagnose = True ,
26
28
rotation = "1 day" ,
27
29
retention = "31 days" ,
28
30
)
29
31
30
- config = cfg . ConfigHandler ( "config.properties" ) # type: ignore
32
+ logger . add ( sys . stderr , level = log_level )
31
33
32
34
# When cargo hold is full, the ship will dock up and unload cargo, undock and warp to another belt
33
35
cargo_loading_time_adjustment = config .get_cargo_loading_time_adjustment ()
@@ -676,5 +678,6 @@ def start_function() -> None:
676
678
677
679
def start () -> None :
678
680
logger .info ("Starting bot" )
681
+ logger .trace ("Hi" )
679
682
# Start Tkinter Window
680
683
root .mainloop ()
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ def __init__(self, config_path): # type: ignore
22
22
self .config = configparser .ConfigParser ()
23
23
self .config .read (config_path )
24
24
25
+ def get_log_level (self ) -> str :
26
+ return self ._get_setting ("log_level" , self .config .get , "INFO" ) # type: ignore
27
+
25
28
def get_hardener_keys (self ) -> List [str ]:
26
29
keys = self ._get_setting ("hardener_keys" , self .config .get , "" )
27
30
return [key .strip () for key in keys .split ("," ) if key .strip ()]
Original file line number Diff line number Diff line change 1
1
[SETTINGS]
2
+ log_level = INFO
2
3
mining_runs =
3
4
mining_hold =
4
5
mining_yield =
You can’t perform that action at this time.
0 commit comments