Conversation
…ault behaviour
warn!: plugin developers must set `Debug` in `configs/{PORT}/{Plugin}/properties.yml` for [DEBUG] messages to appear unless they explictly set the `canBePrinted` parameter of the Debug method
| /// <summary> | ||
| /// Whether debug logs should appear regardless of pre-plugin properties. | ||
| /// </summary> | ||
| /// <seealso cref="LabApi.Loader.Features.Plugins.Configuration.Properties.Debug"/> |
There was a problem hiding this comment.
See line 27, was following the same way LoadUnsupportedPlugins was commented.
| /// Uses explicit <paramref name="canBePrinted"/>. | ||
| /// Can be replaced with the single parameter overload to use <see cref="LabApi.Loader.Features.Plugins.Configuration.Properties.Debug"/> Property instead. | ||
| /// </remarks> | ||
| public static void Debug(object message, bool canBePrinted) |
There was a problem hiding this comment.
Forcing a parameter on devs is in fact, breaking change.
There was a problem hiding this comment.
The overloaded Debug method on line 36 will be used if only 1 parameter is provided. So it is not forced, just explicitly defined. Plugins that are already built will have the default "true" parameter included automatically and the IL will point them to Logger::Debug(object,bool) which is present.
|
Overall on my code comments I was just wanting to be thorough on my reasoning on why I did each one. I'll do a bulk trim of them. |
Co-authored-by: David <david.sebesta@post.cz>
fix: removing references to classes used in an old implementation from PluginLoader.cs
|
Thank you for the feedback. I have made the suggested revisions. :) This change should be inert for plugins compiled for existing LabAPI versions. If the developer did not specify a second parameter the compiler will have included the default true ( call void [LabApi]LabApi.Features.Console.Logger::Debug(object, bool)With this change the 1 parameter overload would be used on new builds call void [LabApi]LabApi.Features.Console.Logger::Debug(object)The This does change the default behaviour of the Debug method, essentially replacing |
Notice to Plugin Developers
Not a breaking change, but developers that have not explicitly set
canBePrintedto true in theirLogger.Debugcalls will not see [DEBUG] message in the Console untildebugis settrueinconfigs/{PORT}/{Plugin}/properties.yml. Existing custom Debug configs will still work if prefered.Changes
debugto plugins' properties.yml to control default Debug log behaviour.Logger.Debug(object)will check for this Debug value before printing.Logger.Debug(object,bool)will override the Debug check.debugvalue is updated when Properties are loaded on initial LabAPI load.debug_override, if settruewill force all Debugs to display, unless overrode byLogger.Debug(object,bool)Notes
Purpose is to prevent console spam of unhandled Debug calls when a plugin is published.
Same names from EXILED were only used to improve experience of developers adopting LabAPI. Implementation is custom but used most optimal patterns if it matched theirs.
Updating the Debug property could be handled on Per-Plugin reload but wanted to reduce changes first time around.