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.
Files changed (29) hide show
  1. {smallneuron-2.1.2/src/smallneuron.egg-info → smallneuron-2.1.4}/PKG-INFO +1 -1
  2. {smallneuron-2.1.2 → smallneuron-2.1.4}/pyproject.toml +1 -1
  3. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/logger.py +18 -3
  4. {smallneuron-2.1.2 → smallneuron-2.1.4/src/smallneuron.egg-info}/PKG-INFO +1 -1
  5. {smallneuron-2.1.2 → smallneuron-2.1.4}/.gitignore +0 -0
  6. {smallneuron-2.1.2 → smallneuron-2.1.4}/LICENSE +0 -0
  7. {smallneuron-2.1.2 → smallneuron-2.1.4}/README.md +0 -0
  8. {smallneuron-2.1.2 → smallneuron-2.1.4}/example.py +0 -0
  9. {smallneuron-2.1.2 → smallneuron-2.1.4}/setup.cfg +0 -0
  10. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/__init__.py +0 -0
  11. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/build +0 -0
  12. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/gpio_h3.c +0 -0
  13. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/gpio_h3.h +0 -0
  14. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/gpio_h3.so +0 -0
  15. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/smallneuron.py +0 -0
  16. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sndummy.py +0 -0
  17. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sngpio.py +0 -0
  18. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sninput.py +0 -0
  19. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/snmqtt.py +0 -0
  20. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/snserial.py +0 -0
  21. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/sntimer.py +0 -0
  22. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron/snwatcher.py +0 -0
  23. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron.egg-info/SOURCES.txt +0 -0
  24. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron.egg-info/dependency_links.txt +0 -0
  25. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron.egg-info/top_level.txt +0 -0
  26. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/PKG-INFO +0 -0
  27. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/SOURCES.txt +0 -0
  28. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/dependency_links.txt +0 -0
  29. {smallneuron-2.1.2 → smallneuron-2.1.4}/src/smallneuron_pelainux.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smallneuron
3
- Version: 2.1.2
3
+ Version: 2.1.4
4
4
  Summary: Small Neuron Workflow
5
5
  Author-email: Andres Artigas <andres@artigas.cl>
6
6
  Project-URL: Homepage, https://github.com/pypa/sampleproject
@@ -3,7 +3,7 @@ requires = ["setuptools", "setuptools-scm"]
3
3
 
4
4
  [project]
5
5
  name = "smallneuron"
6
- version = "2.1.2"
6
+ version = "2.1.4"
7
7
  authors = [
8
8
  { name="Andres Artigas", email="andres@artigas.cl" },
9
9
  ]
@@ -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
- msg = ""
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smallneuron
3
- Version: 2.1.2
3
+ Version: 2.1.4
4
4
  Summary: Small Neuron Workflow
5
5
  Author-email: Andres Artigas <andres@artigas.cl>
6
6
  Project-URL: Homepage, https://github.com/pypa/sampleproject
File without changes
File without changes
File without changes
File without changes
File without changes