Skip to content

Commit c3184e0

Browse files
committed
Remove loguru version checks.
1 parent 4768fba commit c3184e0

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

newrelic/hooks/logger_loguru.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _nr_log_forwarder(message_instance):
6969
try:
7070
time = record.get("time", None)
7171
if time:
72-
time = int(time.timestamp()*1000)
72+
time = int(time.timestamp() * 1000)
7373
record_log_event(message, level_name, time, attributes=attrs)
7474
except Exception:
7575
pass
@@ -116,18 +116,15 @@ def _nr_log_patcher(record):
116116
record["_nr_original_message"] = message = record["message"]
117117
record["message"] = add_nr_linking_metadata(message)
118118

119-
if LOGURU_VERSION > (0, 6, 0):
120-
if original_patcher is not None:
121-
patchers = [p for p in original_patcher] # Consumer iterable into list so we can modify
122-
# Wipe out reference so patchers aren't called twice, as the framework will handle calling other patchers.
123-
original_patcher = None
124-
else:
125-
patchers = []
126-
127-
patchers.append(_nr_log_patcher)
128-
return patchers
119+
if original_patcher is not None:
120+
patchers = [p for p in original_patcher] # Consumer iterable into list so we can modify
121+
# Wipe out reference so patchers aren't called twice, as the framework will handle calling other patchers.
122+
original_patcher = None
129123
else:
130-
return _nr_log_patcher
124+
patchers = []
125+
126+
patchers.append(_nr_log_patcher)
127+
return patchers
131128

132129

133130
def wrap_Logger_init(wrapped, instance, args, kwargs):

tox.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ envlist =
144144
python-framework_tornado-{py39,py310,py311,py312}-tornadomaster,
145145
python-logger_logging-{py37,py38,py39,py310,py311,py312,pypy310},
146146
python-logger_loguru-{py37,py38,py39,py310,py311,py312,pypy310}-logurulatest,
147-
python-logger_loguru-py39-loguru{06,05},
148147
python-logger_structlog-{py37,py38,py39,py310,py311,py312,pypy310}-structloglatest,
149148
python-mlmodel_langchain-{py39,py310,py311,py312},
150149
python-mlmodel_openai-openai0-{py37,py38,py39,py310,py311,py312},
@@ -375,8 +374,6 @@ deps =
375374
mlmodel_langchain: mock
376375
mlmodel_langchain: asyncio
377376
logger_loguru-logurulatest: loguru
378-
logger_loguru-loguru06: loguru<0.7
379-
logger_loguru-loguru05: loguru<0.6
380377
logger_structlog-structloglatest: structlog
381378
messagebroker_pika-pikalatest: pika
382379
messagebroker_pika: tornado<5

0 commit comments

Comments
 (0)