Skip to content

Commit 9cd43d1

Browse files
authored
Change sentinel object to string
1 parent 5a7999c commit 9cd43d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

adafruit_logging.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ def write(self, buf: str) -> int:
113113
for __value, __name in LEVELS:
114114
globals()[__name] = __value
115115

116-
_ROOT_LOGGER_SENTINEL = object()
117-
118116

119117
def _level_for(value: int) -> str:
120118
"""Convert a numeric level to the most appropriate name.
@@ -251,14 +249,15 @@ def _addLogger(logger_name: Hashable) -> None:
251249
logger_cache[logger_name] = new_logger
252250

253251

254-
def getLogger(logger_name: Hashable = _ROOT_LOGGER_SENTINEL) -> "Logger":
252+
def getLogger(logger_name: Hashable = "") -> "Logger":
255253
"""Create or retrieve a logger by name; only retrieves loggers
256254
made using this function; if a Logger with this name does not
257255
exist it is created
258256
259257
:param Hashable logger_name: The name of the `Logger` to create/retrieve, this
260258
is typically a ``str``. If none is provided, the single root logger will
261-
be created/retrieved.
259+
be created/retrieved. Note that unlike CPython, a blank string will also
260+
access the root logger.
262261
"""
263262
_addLogger(logger_name)
264263
return logger_cache[logger_name]

0 commit comments

Comments
 (0)