smallneuron 2.1.2__tar.gz → 2.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {smallneuron-2.1.2/src/smallneuron.egg-info → smallneuron-2.1.4}/PKG-INFO +1 -1
- {smallneuron-2.1.2 → smallneuron-2.1.4}/pyproject.toml +1 -1
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/logger.py +18 -3
- {smallneuron-2.1.2 → smallneuron-2.1.4/src/smallneuron.egg-info}/PKG-INFO +1 -1
- {smallneuron-2.1.2 → smallneuron-2.1.4}/.gitignore +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/LICENSE +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/README.md +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/example.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/setup.cfg +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/__init__.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/build +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/gpio_h3.c +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/gpio_h3.h +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/gpio_h3.so +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/smallneuron.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sndummy.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sngpio.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sninput.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/snmqtt.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/snserial.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sntimer.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/snwatcher.py +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron.egg-info/SOURCES.txt +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron.egg-info/dependency_links.txt +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron.egg-info/top_level.txt +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/PKG-INFO +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/SOURCES.txt +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/dependency_links.txt +0 -0
- {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/top_level.txt +0 -0
|
@@ -2,12 +2,15 @@ import syslog
|
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from time import time
|
|
4
4
|
import sys
|
|
5
|
+
import inspect
|
|
6
|
+
import os
|
|
5
7
|
|
|
6
8
|
class Logger:
|
|
7
9
|
perf_enable=False
|
|
8
10
|
prev_time=time()
|
|
9
11
|
logLevel=syslog.LOG_DEBUG
|
|
10
|
-
def __init__(self, service_name):
|
|
12
|
+
def __init__(self, service_name, include_file_line=False):
|
|
13
|
+
self.include_file_line= include_file_line
|
|
11
14
|
self.service_name = service_name
|
|
12
15
|
self.prefix=""
|
|
13
16
|
|
|
@@ -39,14 +42,26 @@ class Logger:
|
|
|
39
42
|
|
|
40
43
|
def perfMark(self,text):
|
|
41
44
|
if Logger.perf_enable:
|
|
45
|
+
pre=""
|
|
46
|
+
if self.include_file_line:
|
|
47
|
+
frame = inspect.currentframe().f_back
|
|
48
|
+
archivo = os.path.basename(inspect.getfile(frame))
|
|
49
|
+
linea = frame.f_lineno
|
|
50
|
+
pre=f"{archivo}:{linea} - "
|
|
42
51
|
t=time()
|
|
43
|
-
print(self.service_name, t, t-Logger.prev_time, text, file=sys.stderr)
|
|
52
|
+
print(self.service_name, pre, t, t-Logger.prev_time, text, file=sys.stderr)
|
|
44
53
|
Logger.prev_time=t
|
|
45
54
|
|
|
46
55
|
def __logger(self, severity, *args):
|
|
47
56
|
try:
|
|
48
57
|
syslog.openlog(self.service_name, syslog.LOG_CONS | syslog.LOG_PID | syslog.LOG_NDELAY, syslog.LOG_LOCAL1)
|
|
49
|
-
|
|
58
|
+
if self.include_file_line:
|
|
59
|
+
frame = inspect.currentframe().f_back.f_back
|
|
60
|
+
archivo = os.path.basename(inspect.getfile(frame))
|
|
61
|
+
linea = frame.f_lineno
|
|
62
|
+
msg=f"{archivo}:{linea} - "
|
|
63
|
+
else:
|
|
64
|
+
msg = ""
|
|
50
65
|
for a in args:
|
|
51
66
|
msg = msg + " " + str(a)
|
|
52
67
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|