Skip to content

Commit ec99a4c

Browse files
committed
Fix test errors
1 parent 32490fb commit ec99a4c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sarc/logging.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ def setupLogging(verbose_level: int = 0):
3939
"ERROR": logging.ERROR,
4040
"CRITICAL": logging.CRITICAL,
4141
}
42+
4243
conf = config()
43-
assert isinstance(conf, Config)
44-
if conf.logging:
44+
# Apparently this can be called in client mode which doesn't have logging
45+
if isinstance(conf, Config) and conf.logging:
4546

4647
config_log_level = logging_levels.get(conf.logging.log_level, logging.WARNING)
4748
# verbose priority:

tests/functional/test_loki_logging.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ def test_loki_logging_handler(httpserver):
2929
# Configurer l'URL de l'endpoint Loki
3030
# print(f"http://{httpserver.host}:{httpserver.port}/otlp/v1/logs")
3131
loki_url = httpserver.url_for("/otlp/v1/logs")
32-
config().logging.OTLP_endpoint = loki_url
32+
log_conf = config().logging
33+
log_conf.OTLP_endpoint = loki_url
3334

34-
ot_handler = getOpenTelemetryLoggingHandler()
35+
ot_handler = getOpenTelemetryLoggingHandler(log_conf)
3536

3637
ot_handler.flush()
3738
assert len(httpserver.log) == 0

0 commit comments

Comments
 (0)