MCPcopy
hub / github.com/Delgan/loguru / test_level_exists_custom

Function test_level_exists_custom

tests/test_interception.py:143–152  ·  view source on GitHub ↗
(writer)

Source from the content-addressed store, hash-verified

141
142
143def test_level_exists_custom(writer):
144 logging.addLevelName(99, "ANOTHER_FANCY_LEVEL")
145 logger.level("ANOTHER_FANCY_LEVEL", no=99, color="<green>", icon="")
146
147 with make_logging_logger("tests", InterceptHandler()) as logging_logger:
148 logger.add(writer, format="<lvl>{level.no} - {level.name} - {message}</lvl>", colorize=True)
149 logging_logger.log(99, "Yep!")
150
151 result = writer.read()
152 assert result == "\x1b[32m99 - ANOTHER_FANCY_LEVEL - Yep!\x1b[0m\n"
153
154
155def test_using_logging_function(writer):

Callers

nothing calls this directly

Calls 6

make_logging_loggerFunction · 0.85
InterceptHandlerClass · 0.85
levelMethod · 0.80
addMethod · 0.80
logMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…