Skip to content

Commit cb182f1

Browse files
committed
Go back to manually setting the logger name
Add a description of the problem to be addressed in the future.
1 parent 73ce7ad commit cb182f1

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/log.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@ def resolve_log_level() -> int:
5757

5858
def get_logger(name: str) -> logging.Logger:
5959
"""Create a common logger for all modules in this package."""
60-
# Normally this is derived from the package name
61-
return logging.getLogger(name)
62-
# return logging.getLogger(f"{DEFAULT_LOGGER_NAME}.{name}")
60+
# FIXME: Remove the need for this function.
61+
#
62+
# Normally this is derived from the package name (__name__).
63+
#
64+
# Since this program is sometimes called from from the entrypoint and
65+
# sometimes called from src/lightspeed_stack.py, the value for __name__
66+
# does not contain a consistent root value.
67+
#
68+
# How the application is installed and run needs to be streamlined so that
69+
# __name__ provides the expected value in all cases.
70+
return logging.getLogger(f"{DEFAULT_LOGGER_NAME}.{name}")
6371

6472

6573
@lru_cache

0 commit comments

Comments
 (0)