Skip to content

Commit

Permalink
Merge pull request #10 from DRincs-Productions/7-log-system
Browse files Browse the repository at this point in the history
7 log system
  • Loading branch information
BlackRam-oss committed Oct 28, 2022
2 parents 30f50b8 + 5533b74 commit 8f99c49
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions game/tool/core.rpy
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
define config.log = "log.txt"

label after_load:
$ flags = updateFlags(flags, flag_keys)
return
31 changes: 31 additions & 0 deletions game/tool/log_system.rpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 'define config.log' is in core.rpy
define error_notify = _("Where was an ERROR. Please send the developer the logs found in: [config.log]")
define warn_notify = _("Where was an WARN. Please send the developer the logs found in: [config.log]")
define info_notify = false


label log_error(msg, filename_line):
renpy.log("Error: " + msg)
call log_filename_line(filename_line)
if error_notify:
$ notify(error_notify)
return

label log_warn(msg, filename_line):
renpy.log("Warn: " + msg)
call log_filename_line(filename_line)
if warn_notify:
$ notify(warn_notify)
return

label log_info(msg, filename_line):
renpy.log("Info: " + msg)
call log_filename_line(filename_line)
if info_notify:
$ notify(info_notify)
return

label log_filename_line(filename_line):
if filename_line:
renpy.log("filename_line: " + filename_line)
return

0 comments on commit 8f99c49

Please sign in to comment.