Skip to content
This repository was archived by the owner on May 3, 2021. It is now read-only.

Commit 514a9d7

Browse files
committed
Removed ''(!)'' in manual log entries
PEP8 compliance with trailing new line
1 parent 965f97a commit 514a9d7

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

core/decorators.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import sys
22
import functools
3-
import logging
43

54

65
"""
76
Details:
87
2020-07-05
98
10-
CommandIntegrator framework source file with decorator
9+
commandintegrator framework source file with decorator
1110
objects
1211
1312
This module contains functions and classes that are
@@ -37,9 +36,9 @@ class Logger:
3736
the wrapped method are both logged to the log file using
3837
the static 'logging' instance, configured for the class.
3938
Simply add the decorator above your method to enable logging
40-
for it. Presuming you import this package as CommandIntegrator;
39+
for it. Presuming you import this package as commandintegrator;
4140
42-
@CommandIntegrator.logger.log
41+
@commandintegrator.logger.log
4342
def myfunc(self, *args, **kwargs):
4443
...
4544
@@ -53,7 +52,7 @@ def myfunc(self, *args, **kwargs):
5352

5453
def __verify_config_complete(self):
5554
if Logger.LOG_INSTANCE == None:
56-
sys.stderr.write('CommandIntegrator -- logging error: Cannot log, no log set.\r\n')
55+
sys.stderr.write('commandintegrator -- logging error: Cannot log, no log set.\r\n')
5756
sys.stderr.write('Configure an instance of logger, and pass it to Logger.set_logger()\r\n.')
5857

5958
@staticmethod
@@ -91,7 +90,7 @@ def inner(*args, **kwargs):
9190
return inner
9291

9392
@staticmethod
94-
def log(message: str, level = 'debug') -> None:
93+
def log(message: str, level='debug') -> None:
9594
"""
9695
Allow for manual logging during runtime.
9796
:param message:
@@ -100,7 +99,7 @@ def log(message: str, level = 'debug') -> None:
10099
:returns:
101100
arbitrary
102101
"""
103-
_log_output = f'(!) Manual log entry: {message}'
102+
_log_output = f'Manual log entry: {message}'
104103
_log_levels = {'info': lambda _message: Logger.LOG_INSTANCE.info(_message),
105104
'debug': lambda _message: Logger.LOG_INSTANCE.debug(_message),
106105
'error': lambda _message: Logger.LOG_INSTANCE.error(_message)}
@@ -113,6 +112,7 @@ def log(message: str, level = 'debug') -> None:
113112
def set_logger(logging):
114113
Logger.LOG_INSTANCE = logging
115114

115+
116116
def scheduledmethod(func):
117117
"""
118118
Scheduled method decorator. In certain applications
@@ -142,4 +142,4 @@ def scheduled_method_wrapper(*args, **kwargs):
142142
'result': func(*args, **kwargs),
143143
'channel': channel
144144
}
145-
return scheduled_method_wrapper
145+
return scheduled_method_wrapper

0 commit comments

Comments
 (0)