-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_app.py
executable file
·97 lines (81 loc) · 2.99 KB
/
test_app.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python3
import sentry_sdk
from pawnlib.config import pawnlib_config as pawn
# from pawnlib.output import dump, get_script_path, debug_logging
__version = "0.0.1"
sentry_sdk.init(
dsn="https://[email protected]/4505633932181504",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_rate=1.0,
profiles_sample_rate=1.0,
# Alternatively, to control sampling dynamically
# profiles_sampler=profiles_sampler
)
def print_banner():
print('[97m')
print('--------------------------------------------------')
print('\n')
print(' ')
print(' _ _ ')
print(' ___ _____ ____ _| |_ ____ _ _ _| |_ ____ _____ ____ _____ ____ ')
print(' /___) ___ | _ (_ _)/ ___) | | | (_ _)/ ___|____ |/ ___) ___ |/ ___)')
print('|___ | ____| | | || |_| | | |_| |______| |_| | / ___ ( (___| ____| | _ ')
print('(___/|_____)_| |_| \__)_| \__ (_______)__)_| \_____|\____)_____)_| (_)')
print(' (____/ ')
print(' ')
print(' ')
print(' ____ _ _ ')
print('| _ \| | | |')
print('| |_| | |_| |')
print('| __/ \__ |')
print('|_| (____/ ')
print('')
print(' - Description : This is script')
print(' - Version : {__version}')
print(' - Author : root')
print('\n')
print('--------------------------------------------------')
print('[0m')
def main():
app_name = "sentry_tracer.py"
log_time_format = '%Y-%m-%d %H:%M:%S.%f'
# current_path = get_script_path(__file__)
stdout = True
pawn.set(
# PAWN_PATH=current_path,
PAWN_LOGGER=dict(
log_level="INFO",
stdout_level="INFO",
# log_path=f"{current_path}/logs",
stdout=stdout,
use_hook_exception=True,
),
# PAWN_TIME_FORMAT=log_time_format,
# PAWN_CONSOLE=dict(
# redirect=True,
# record=True
# ),
PAWN_DEBUG=True, # Don't use production, because it's not stored exception log.
app_name=app_name,
data={}
)
# pawn.app_logger.info("App logger initializing")
# pawn.error_logger.debug("Debug logger initializing")
# # pawn.error_logger.error("Error logger initializing")
# pawn.console.log(pawn.to_dict())
#
# debug_logging(pawn.to_dict())
# dump(pawn.to_dict())
if __name__ == "__main__":
try:
print_banner()
main()
except KeyboardInterrupt:
pawn.console.log("Keyboard Interrupted")
except Exception as e:
pawn.console.print_exception(
show_locals=pawn.get("PAWN_DEBUG", False),
width=160
)