Skip to content

Commit fb80627

Browse files
committed
Disabling contracts can now be done directly rather than through Tracker construction
1 parent 175b63d commit fb80627

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

snowplow_tracker/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
from snowplow_tracker.subject import Subject
33
from snowplow_tracker.consumer import Consumer, AsyncConsumer, CeleryConsumer, RedisConsumer
44
from snowplow_tracker.tracker import Tracker
5+
from contracts import disable_all, enable_all

snowplow_tracker/tracker.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Tracker:
5858
@contract
5959
def __init__(self, out_queue, _subject=None,
6060
namespace=None, app_id=None, context_vendor=None, encode_base64=DEFAULT_ENCODE_BASE64,
61-
contracts=True, log=True):
61+
contracts=True):
6262
"""
6363
:param out_queue: Consumer to which events will be sent
6464
:type out_queue: consumer
@@ -74,15 +74,10 @@ def __init__(self, out_queue, _subject=None,
7474
:type encode_base64: bool
7575
:param contracts: Whether to enable contracts
7676
:type contracts: bool
77-
:param log: Whether to enable Python logging
78-
:type log: bool
7977
"""
8078
if not contracts:
8179
disable_all()
8280

83-
if not log:
84-
logger.setLevel(logging.CRITICAL)
85-
8681
if _subject is None:
8782
_subject = subject.Subject()
8883

0 commit comments

Comments
 (0)