Skip to content

Commit 3080cac

Browse files
committed
Logging after imports
1 parent 2ee0681 commit 3080cac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Adafruit_TSL2561/Adafruit_TSL2561.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
"""
3232

3333
import logging
34-
# Logging needs to be set before any other library is imported
35-
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
36-
3734
import sys
3835
import time
3936
from Adafruit_I2C import Adafruit_I2C
4037

38+
# Logging needs to be set at top
39+
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
40+
41+
4142

4243
class AdafruitTSL2561(Adafruit_I2C):
4344
TSL2561_VISIBLE = 2 # channel 0 - channel 1

Adafruit_TSL2561/Adafruit_TSL2561_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# Get the calculated lux value, this is a spot reading so if you're under light
1313
lux = LightSensor.calculate_lux()
1414

15-
print ('Lux value is %d',lux)
15+
print('Lux value is %d',lux)
1616

1717

0 commit comments

Comments
 (0)