File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,9 @@ def setup_logging(
157
157
else :
158
158
handlers = ['pretty' ]
159
159
160
+ # Flag to enable debug level for both sync-v1 and sync-v2.
161
+ debug_sync = False and debug
162
+
160
163
# See: https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
161
164
logging .config .dictConfig ({
162
165
'version' : 1 ,
@@ -207,6 +210,14 @@ def setup_logging(
207
210
'handlers' : handlers ,
208
211
'level' : 'DEBUG' if debug else 'INFO' ,
209
212
},
213
+ 'hathor.p2p.sync_v1' : {
214
+ 'handlers' : handlers ,
215
+ 'level' : 'DEBUG' if debug_sync else 'INFO' ,
216
+ },
217
+ 'hathor.p2p.sync_v2' : {
218
+ 'handlers' : handlers ,
219
+ 'level' : 'DEBUG' if debug_sync else 'INFO' ,
220
+ }
210
221
}
211
222
})
212
223
Original file line number Diff line number Diff line change 10
10
from twisted .trial import unittest
11
11
12
12
from hathor .builder import BuildArtifacts , Builder
13
+ from hathor .cli .util import setup_logging
13
14
from hathor .conf import HathorSettings
14
15
from hathor .conf .get_settings import get_settings
15
16
from hathor .daa import TestMode , _set_test_mode
@@ -104,14 +105,15 @@ class TestCase(unittest.TestCase):
104
105
seed_config : Optional [int ] = None
105
106
106
107
def setUp (self ):
108
+ setup_logging ()
107
109
_set_test_mode (TestMode .TEST_ALL_WEIGHT )
108
110
self .tmpdirs = []
109
111
self .clock = TestMemoryReactorClock ()
110
112
self .clock .advance (time .time ())
111
113
self .log = logger .new ()
112
114
self .reset_peer_id_pool ()
113
115
self .seed = secrets .randbits (64 ) if self .seed_config is None else self .seed_config
114
- self .log .debug ('set seed' , seed = self .seed )
116
+ self .log .info ('set seed' , seed = self .seed )
115
117
self .rng = Random (self .seed )
116
118
self ._pending_cleanups = []
117
119
self ._settings = get_settings ()
You can’t perform that action at this time.
0 commit comments