Skip to content

Commit 8f99c49

Browse files
authored
Merge pull request techwithtim#10 from DRincs-Productions/7-log-system
7 log system
2 parents 30f50b8 + 5533b74 commit 8f99c49

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

game/tool/core.rpy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
define config.log = "log.txt"
2+
13
label after_load:
24
$ flags = updateFlags(flags, flag_keys)
35
return

game/tool/log_system.rpy

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 'define config.log' is in core.rpy
2+
define error_notify = _("Where was an ERROR. Please send the developer the logs found in: [config.log]")
3+
define warn_notify = _("Where was an WARN. Please send the developer the logs found in: [config.log]")
4+
define info_notify = false
5+
6+
7+
label log_error(msg, filename_line):
8+
renpy.log("Error: " + msg)
9+
call log_filename_line(filename_line)
10+
if error_notify:
11+
$ notify(error_notify)
12+
return
13+
14+
label log_warn(msg, filename_line):
15+
renpy.log("Warn: " + msg)
16+
call log_filename_line(filename_line)
17+
if warn_notify:
18+
$ notify(warn_notify)
19+
return
20+
21+
label log_info(msg, filename_line):
22+
renpy.log("Info: " + msg)
23+
call log_filename_line(filename_line)
24+
if info_notify:
25+
$ notify(info_notify)
26+
return
27+
28+
label log_filename_line(filename_line):
29+
if filename_line:
30+
renpy.log("filename_line: " + filename_line)
31+
return

0 commit comments

Comments
 (0)