Classed based logger for Python
Project description
Class Based Logger for Python
Installation
pip install tdlogging
Usage
tdlogger.txt
exception
log exceptionscount
log counttime
log time elapsedreturn
log return valueexec
log count, time, and return
# fib.py
from tdlogging.tdlogger import create_logger
logger = create_logger(path="/path/to/tdlogger.txt/")
@logger.get_logger()
class Fib:
@staticmethod
def get_n(n):
a = 0
b = 1
if n == 0:
return a
elif n == 1:
return b
else:
for i in range(2, n):
c = a + b
a = b
b = c
return b
Fib.get_n(9)
> python fib.py
┎──────────TDLogger──────────┒
┃ --Method get_n Executed-- ┃
┃ Arguments: { ┃
┃ 'n': 9, ┃
┃ } ┃
┃ Times Executed: 1 ┃
┃ Execution Time: 0.000s ┃
┃ Return Value: 21 ┃
┃ Return Type: <class 'int'> ┃
┖────────────────────────────┚
Change log
[0.0.2] - 2020-04-02
Added
tdprinter.py
Edited
tdprinter.py
tdlogger.py
[0.0.1] - 2020-04-01
Added
tdlogger.py
HISTORY.md
README.md
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tdlogging-0.0.3.tar.gz
(3.5 kB
view hashes)