-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from DRincs-Productions/7-log-system
7 log system
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |