Skip to content

Commit b09f5f1

Browse files
committed
Centralize INSTANA_DEV and debug logging.
1 parent 1d2649f commit b09f5f1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

instana/options.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23

34

45
class Options(object):
@@ -8,4 +9,7 @@ class Options(object):
89
log_level = logging.WARN
910

1011
def __init__(self, **kwds):
12+
if "INSTANA_DEV" in os.environ:
13+
self.log_level = logging.DEBUG
14+
1115
self.__dict__.update(kwds)

instana/runtime.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ def hook(module):
1111
print("==========================================================")
1212
print("Instana: Running runtime hook")
1313
print("==========================================================")
14-
level = logging.DEBUG
15-
else:
16-
level = logging.WARN
1714

18-
opts = options.Options(log_level=level)
15+
opts = options.Options()
1916
ot.global_tracer = tracer.InstanaTracer(opts)

instana/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class iWSGIMiddleware(object):
99

1010
def __init__(self, app):
1111
self.app = app
12-
opts = options.Options(log_level=logging.DEBUG)
12+
opts = options.Options()
1313
ot.global_tracer = tracer.InstanaTracer(opts)
1414
self
1515

0 commit comments

Comments
 (0)