Compare commits
No commits in common. "0139dff41c409f1b41758951ad93b5aa6674fc47" and "5238a083094b9e8aa83ab9dc64b72c3cbb7437cc" have entirely different histories.
0139dff41c
...
5238a08309
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
build/
|
|
||||||
*.egg-info/
|
|
||||||
@ -105,24 +105,6 @@ class MyLogger:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def debug_params(name, d, maxlen=100):
|
|
||||||
"""Compact debug output: show all keys but truncate long values."""
|
|
||||||
if not isinstance(d, dict):
|
|
||||||
debug(f'{name}: {d}')
|
|
||||||
return
|
|
||||||
summary = {}
|
|
||||||
for k, v in d.items():
|
|
||||||
s = str(v)
|
|
||||||
if len(s) > maxlen:
|
|
||||||
summary[k] = s[:maxlen] + f'...({len(s)}ch)'
|
|
||||||
elif isinstance(v, list) and len(v) > 3:
|
|
||||||
summary[k] = f'[{len(v)} items]'
|
|
||||||
else:
|
|
||||||
summary[k] = v
|
|
||||||
debug(f'{name}: {summary}')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def clientinfo(message):
|
def clientinfo(message):
|
||||||
frame_info = inspect.currentframe()
|
frame_info = inspect.currentframe()
|
||||||
logger = MyLogger('Test')
|
logger = MyLogger('Test')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user