Project-Wide Logger In Verse
112,122 Views
-
my_log_channel<public> := class(log_channel): # A project-wide "Logger" to print messages from functions that are not in a class with a log. # The non-Logger Print is <no_rollback>, so it can't be used in a <transacts> function. ProjectLog<public>(Message:[]char, ?Level:log_level = log_level.Normal)<transacts>:void= Logger := log{Channel := my_log_channel} Logger.Print(Message, ?Level := Level) # Usage: ProjectLog("EndGame: Player has won!", ?Level := log_level.Verbose) # You don't have to specify the Level ProjectLog("Hello Verse!")my_log_channel<public> := class(log_channel):
A project-wide "Logger" to print messages from functions that are not in a class with a log.
The non-Logger Print is <no_rollback>, so it can't be used in a <transacts> function.
ProjectLog<public>(Message:[]char, ?Level:log_level = log_level.Normal)<transacts>:void= Logger := log{Channel := my_log_channel} Logger.Print(Message, ?Level := Level)
Usage:
ProjectLog("EndGame: Player has won!", ?Level := log_level.Verbose)
You don't have to specify the Level
ProjectLog("Hello Verse!")
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.