Skip to content

Commit

Permalink
Use named logger instead of setting root logger in natlinkcore library.
Browse files Browse the repository at this point in the history
Use named logger instead of setting root logger in natlinkcore library.
  • Loading branch information
LexiconCode authored Mar 30, 2024
1 parent 2dd7df4 commit e08548b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/natlinkcore/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def startDap(config : NatlinkConfig) -> bool:


def run() -> None:
default_logger=logging.getLogger()
default_logger=logger=logging.getLogger("natlink")
dh = OutputDebugStringHandler()
sh=logging.StreamHandler(sys.stdout)
for h in [sh,dh]:
Expand All @@ -688,7 +688,8 @@ def run() -> None:
config = NatlinkConfig.from_first_found_file(config_locations())

dap_started = config.dap_enabled and startDap(config)
logger=logging.getLogger("natlink")
logger=logging.getLogger("natlinkcore")
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.DEBUG)

main = NatlinkMain(logger, config)
Expand All @@ -709,4 +710,4 @@ def run() -> None:
natlink.natConnect()
run()
natlink.natDisconnect()


0 comments on commit e08548b

Please sign in to comment.