Skip to content

Commit f78efb2

Browse files
committed
Merge JoinMarket-Org#644: Fix bug: configuring log level from joinmarket.cfg now works as intended
9fba63a Fix bug: configuring log level from joinmarket.cfg now works as intended (Alex Cato)
2 parents 655407b + 9fba63a commit f78efb2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

joinmarket/configure.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,8 @@ def initialize_console_logger(log_level):
299299
log.info('hello joinmarket')
300300

301301
def load_program_config():
302-
# set the console log level and initialize console logger
303-
try:
304-
global_singleton.console_log_level = global_singleton.config.get(
305-
"LOGGING", "console_log_level")
306-
except (NoSectionError, NoOptionError):
307-
log.info("No log level set, using default level INFO ")
308-
initialize_console_logger(global_singleton.console_log_level)
309-
310302
#set the location of joinmarket
311303
jmkt_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
312-
log.info("Joinmarket directory is: " + str(jmkt_dir))
313304
global_singleton.config.readfp(io.BytesIO(defaultconfig))
314305
jmkt_config_location = os.path.join(jmkt_dir, global_singleton.config_location)
315306
loadedFiles = global_singleton.config.read([jmkt_config_location])
@@ -331,6 +322,15 @@ def load_program_config():
331322
"Config file does not contain the required option: " + o +\
332323
" in section: " + k)
333324

325+
# set the console log level and initialize console logger
326+
try:
327+
global_singleton.console_log_level = global_singleton.config.get(
328+
"LOGGING", "console_log_level")
329+
except (NoSectionError, NoOptionError):
330+
log.info("No log level set, using default level INFO ")
331+
initialize_console_logger(global_singleton.console_log_level)
332+
log.info("Joinmarket directory is: " + str(jmkt_dir))
333+
334334
try:
335335
global_singleton.maker_timeout_sec = global_singleton.config.getint(
336336
'TIMEOUT', 'maker_timeout_sec')

0 commit comments

Comments
 (0)