-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
34 lines (27 loc) · 755 Bytes
/
example.py
File metadata and controls
34 lines (27 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from fastlog import log
import traceback
log.info("Familiar log functions:")
log.info("log.info")
log.success("log.success")
log.failure("log.failure")
log.debug("You don't see me! The default level is log.INFO")
log.setLevel(log.DEBUG)
log.debug("log.debug")
log.warning("log.warning")
try:
log.exception("log.exception")
except Exception as e:
traceback.print_exc()
pass
log.separator()
log.info("Indent logs using Python's 'with:'")
log.warning("First level block")
with log.indent():
log.warning("Second level block")
with log.indent():
log.warning("Third level block")
log.warning("Back to second")
log.warning("Back to first")
log.separator()
from fastlog import hexdump
log.hexdump(list(map(chr, range(256))))