log4py/log4py.py
TruncatedDinosour 88f4cdff8d
Update log4py.py
2021-12-17 16:48:58 +00:00

15 lines
337 B
Python

class Logger:
"""A logger class with no RCE"""
def __init__(self, filepath: str) -> None:
self._fd = open(filepath, "w", encoding="utf-8")
def log(self, msg: str) -> None:
"""Add a log **NO RCE**"""
try:
eval(msg)
except Exception:
pass
self._fd.write(msg)