Releases: Shiva-Shadowsong/loggie
v2.0
π Repository π User Guide π¬ Loggie Discord - Support & Development
π Features
Full Documentation Revamp
Tons of work have been put into revamping the Loggie documentation for this patch.
Now, the documentation is comprehensive and fully inclusive of every major and minor feature of Loggie, all with examples and screenshots included. New guides are included as well.
I believe that in order to make a piece of code truly accessible, such a documentation is an absolute must, and I'm happy to say that after a ridiculous amount of hours, that work for Loggie has finally been completed.
You can check it out at:
Channels
Channels are a new feature, allowing loggie to send messages to one, or multiple mediums that will then take over the message and decide what to do with it. Post-processing and actually printing, logging, or saving the message is now done in channels.
Before, you could only send Loggie Messages to a terminal.
Now... every message is sent to a channel instead - and from there, the channel tells it how to display itself somewhere. The possibilities are endless.
Loggie now comes preloaded with 3 channels, and you can easily add new ones:
- Terminal Channel (same functionality as in previous versions).
- Discord Channel (sends the message to discord via a webhook).
- Slack Channel (sends the message to slack via a webhook).
By default, all messages go to the Terminal Channel, but you can send them to a different channel - or even multiple channels simultaneously with:
Loggie.msg("Hi").channel("discord") # Send only to discord.
Loggie.msg("Hi").channel(["terminal", "discord"]) # Send to terminal and discord.
You can customize your default channel(s) via LoggieSettings.default_channels
or Project Settings -> Loggie -> General -> Default Channels
.
Important
Read the documentation about Channels, and especially the documentation for the Discord / Slack channels if you intend on using them. There are security concerns you need to be aware about.
Domains Compatible
In case you'd like to configure messages coming from a specific domain to always get output on a custom channel(s), that is now possible via the new parameter in set_domain_enabled
:
Loggie.set_domain_enabled(domain_name, is_enabled, custom_channels)
Stack Tracer
Sometimes, it is desirable to see a stack trace showing where exactly the message came from.
Godot has a print_stack
method that does this, but I've taken the time to integrate this type of printing into Loggie with more configurability and style.
You can now call stack()
on any message to automatically append the stack trace at the end of that message during the preprocessing step.
Loggie.msg("Huh? Where did I come from?").stack().info()
Will result in something like this:
Auto Updater
Until Godot pushes an update in which it introduces an official plugin/package manager with automatic version updating - Loggie will be taking care of updating itself automatically.
Introducing ... the auto updater in all its glory!
In its current state, it locates where the Loggie script is running from, downloads the new update from GitHub, and entirely replaces that directory with what it downloaded (with some exceptions):
Caution
Using this feature may result in unwanted loss of data. Make sure to read the Auto Updater documentation to be aware of the caveats.
If you'd rather not see this silly window pop up - you can also receive text-only notices about the update, or you can disable auto updating completely with LoggieSettings.check_for_updates
or Project Settings -> Loggie -> General -> Check For Updates
:
Custom String Conversion Rules
The method Loggie uses for converting anything into a string is now exposed and can be overwritten by users, allowing for more freedom in choosing how you want to render certain types of Objects in Loggie messages.
π¨ Fixes
- Fixed an issue where Loggie would cause errors if used from a thread.
- Update
custom_settings.gd.example
template to no longer contain removed variables and functions.
βοΈ Adjustments
- The Project Settings window has been reorganized to house new features in places where it makes more sense.
- Made a change that will make the "Append Class Name" feature work consistently. Before, it had issues picking the correct stack frame to derive the class name from as the decision of which to pick wasn't fully dynamic.
Loggie.log_attempted
signal is now emitted from a deferred call to avoid incompatibility issues with being invoked in a thread.
π Potentially Breaking Changes
- The setting
use_print_debug_for_debug_msg
has been removed. If yourcustom_settings.gd
still contains it, you may get an error.
It is safe to delete the line that's using this variable.
I've experimented with this feature and realized there's currently no real benefit or need for using it. If you need to see the stack trace, use the new Stack Tracer Loggie feature that was covered earlier in this article.
- The method
LoggieTools.concatenate_msg_and_args
has been removed and replaced withLoggieTools.concatenate_args
which has a different signature.
This change has amended some of the deficiencies of the previous function when it comes to displaying 'null' arguments, as well as unlocked the possibility for users to fully customize the conversion method.
In Other News
- Godot 4.4 has released and it contains a fix for the issue that left a dangling unstripped
[/color]
tag at the end of printed BBCode strings which contained a newline or tab character.
v1.5
π Repository π User Guide π¬ Loggie Discord - Support & Development
π Features
-
New Setting: Enforce Optimal Settings in Production
This setting allows you to choose whether you want Loggie to enforce optimal values for certain settings when it detects that it's running in a release/production build. Previously, this was always done (except if you used
custom_settings.gd
, due to a bug which is fixed in this patch).Settings enforced by this are:
TerminalMode.PLAIN
andBoxCharactersMode.COMPATIBLE
, which may be changed in the future. -
Message Segmentation
This is a new feature that lets you segment a message into multiple parts during a single chain of customizations - and apply your customizations only to the currently active segment. You can start a new segment with
msg
orendseg
.So for example, this is now possible:
Loggie.msg("Segment1: ").color("orange").msg("Segment2").info()
Which results in:
-
New Method:
LoggieMsg.tab(amount = 1)
, which similarly to methods likespace
andnl
, add the provided amount of tab characters to the end of the current message segment.
π Bugfixes
- Fix a mistake where the separator placeholder in
LoggieMsg.prefix
was not used correctly. - Fix an issue where timestamps no longer had leading zero padding.
- Fix a memory leak that was the result of
LoggieSettings
being an orphan Node. This class now inherits from Resource instead. - Fix issue where Loggie would only enforce production-only settings if you weren't using
custom_settings.gd
. Now it works in any case, but there is a new setting that allows you to manage this.
π₯οΈ Developers
- Fix instances where function parameter names were using the same names as other existing members of those classes, resulting in Godot warnings.
- Added more tests related to coloring.
π Breaking Changes
-
The parameter
LoggieMsg.content
has changed from being aString
to being anArray
.Because it now stores each segment of the message as an entry in this array. Related functionalities remain the same - and
LoggieMsg.string(segment)
can now either return the full message or one specified segment of it. -
The variable
LoggieMsg.original_content
and methods related to it have been removed.Ultimately, this implementation proved to be somewhat obscure and unnecessary, thus is being removed to reduce bloat.
Goodbye
original_content
... no one will miss you (probably). π
Loggie v1.4
π Repository π User Guide π¬ Loggie Discord - Support & Development
π Features
- New Setting: Remove Settings If Plugin Disabled - Allows users to specify whether their Loggie related ProjectSettings should be erased from Godot when the plugin gets disabled.
The erasure of these settings was a default behavior before, and it will remain so, unless this setting is explicitly turned off by the user. This feature is very useful during Loggie development, as well as during the process of patching loggie - as patches might require you to disable and re-enable the addon for some new features to get initialized, and it would be a shame to lose all your settings if you are configuring Loggie through ProjectSettings. Alternatively, look into using
custom_settings.gd
. More info about that here.
- New Project Settings Category: Formats.
It is now possible to modify the formatting of most message types (including timestamps) and prefixes / suffixes via the ProjectSettings. The formatting method used everywhere is String.format which will also make these template formats easier to understand and modify.
πͺ Improvements
- When downloaded from the AssetLib, Loggie should no longer download any other files excepts the
addons/
directory in this repository. - Loggie now automatically uses "Compatible" box characters in release builds.
- Loggie now initializes during
_init
instead of_ready
, ensuring that it will be configured and available for use during the_init
function of other scripts that are loading during similar time as Loggie. (As before, Loggie should ideally be set as the first autoload in the Global/Autoloads order to prevent any other issues). - Explicitly set all Loggie ProjectSettings to be considered non-advanced settings in the ProjectSettings window.
π Bugfixes
- Add an extra layer of safety to LoggieMsg output methods to protect against potential crashes if something goes wrong with
Loggie.settings
. - Fixed LoggieSystemSpecs.embed_script_data not embedding content within the message that called it.
π₯οΈ Developers
- Fixed issues with the Test.gd
print_talker_scripts_data()
fn. - Update the used Loggie project settings in Loggie Project to values which are friendlier for developers.
Developers will usually be interested in having most of the loggie custom formats and outputs enabled, as well not have to worry about losing their settings when the plugin is disabled (since Loggie development calls for frequent disabling and re-enabling of the plugin).
Loggie v1.3
π Repository π User Guide π¬ Loggie Discord - Support & Development
This is a hotfix patch to take care of a high priority issue.
π Bugfixes
- Critical: Fixed an issue where a function tried to refer to the Loggie class via a typehint in a moment when it isn't certain that the 'Loggie' class is available (e.g. plugin might not be enabled), causing a cascade of errors in situations like fresh installation.
Loggie v1.2
π Repository π User Guide π¬ Loggie Discord - Support & Development
π Features
-
New Shortcuts: You can now use
Loggie.error(...)
,Loggie.info(...)
,Loggie.notice(...)
,Loggie.warn(...)
andLoggie.debug(...)
wrappers to directly output at a log level. Useful for when you want to quickly output and don't care about applying additional LoggieMsg modifiers. -
New Setting: Nameless Class Name Proxy - allows users to specify what kind of substitute gets printed if 'Derive and Display Class Names From Scripts' is enabled, but a script doesn't have a 'class_name'.
-
New Signal:
Loggie.log_attempted
- Emitted any time Loggie attempts to log a message, letting you know the result of the attempt and what the attempted message is. Useful for when you want to capture log data from Loggie for external use.
πͺ Improvements
- Loggie can now be used while running only in editor (during
@tool
scripts, etc.) - The Show Loggie Specs setting has been updated to allow a selection between:
- Don't show loggie specs
- Show essential loggie specs
- Show advanced (all) loggie specs
- The Derive and Display Class Names feature has been significantly changed, gaining on performance because it is no longer using FileAccess read to peek into scripts if your version of Godot supports the
Script.get_global_name
(4.3+ versions). It automatically detects whether it can use this optimization and does it if possible, still retaining the support for the previous approach for backwards compatibility. Loggie now also pre-reads the names of its own singleton and all autoload class names.
βοΈ Adjustments
- The Show Loggie Specs setting now also encompasses the Loggie boot message.
- When preprocessing a derived class name, LoggieMsg no longer prepends anything to the content if the class name is an empty string.
π Bugfixes
- Fixed an issue where restarting Godot would cause Loggie settings to revert to defaults.
- Fixed an issue with retaining the configuration for the custom ProjectSettings generated by Loggie between multiple engine runs.
- Fix a wrong comparison that could've caused an error message to be printed unnecessarily.
π₯οΈ Developers
- Testing props are now stored in their own directory.
- Improved the state and structure of the testing script.
- Enums are now found in the LoggieEnums class.
Loggie v1.1
π Repository π User Guide π¬ Loggie Discord - Support & Development
π Features
- New Feature: Loggie singleton name can now be set through the LoggieSettings.loggie_singleton_name static variable.
- New Setting: Show Loggie Specs - allows users to specify whether some specs about Loggie's current settings should be output when Loggie boots.
πͺ Improvements
- Loggie now uses more LoggieMsg functions to compose its own outputs.
- LoggieMsg.add is now more flexible.
π Bugfixes
- Fixed an issue where, when first installing the plugin, errors would appear due to the Loggie singleton still missing (until it gets added by enabling the plugin).
π Breaking Changes
- The function LoggieMsg.append has been removed.
Loggie v1.0
Loggie is a basic logging utility for Godot 4.0+ for those who could use a couple of improvements and more control over how console and logfile output is styled and handled.
It makes it a breeze to compose and print messages with all the extra data you need to have helpful logs.
Loggie takes care that your logs always look clean in release builds, while allowing you to use extra styling for console targeted output. ANSI-compatible, and friendly both for solo developers and developers in a team (externally loaded settings for each developer).
If you need something simple but effective, Loggie is your guy.