Skip to content
Exodia edited this page Sep 20, 2023 · 3 revisions

Logs System

Logs System is my custom renpy logging. I added a error, warn and info level and i print the log into the file and terminal. And I add a possibility to add notyfications in the game.

Enable Logs File

To enable the logs file you need to add this in your project, you need add this into core.rpy file (you can change the name of the file):

define config.log = "log.txt"

For Enable and Custom a game notification

For enable the game notification you need read the Notification System section.

For custom the game notification you need to add this in your project:

define error_notify = __("There is an {color=#f00}{b}ERROR{/b}{/color}. Please send the developer the logs found in: {color=#00ccff}[config.log]{/color}")
define warn_notify = __("There is an {color=#f5bc02}{b}WARN{/b}{/color}. Please send the developer the logs found in: {color=#00ccff}[config.log]{/color}")
define info_notify = False # if you set a notyfication to false, the notyfication not show the info notyfication

Log Error

log_error("This is a error log")
log_error("This is a error log", "filename line or other")

Log Warn

log_warn("This is a warn log")
log_warn("This is a warn log", "filename line or other")

Log Info

log_info("This is a info log")
log_info("This is a info log", "filename line or other")