- Adds new menu item to /xldev to disable Safe Mode, allowing users to load plugins again.
- Safe mode cannot be re-enabled once disabled.
- Add new ModuleLog.Create<T> for eventual ILogger magic
- Make safe mode writable
- Remove redundant check in CheckPolicy
* wip
* hacky fix for overlapping event text in profiler
* move IsResumeGameAfterPluginLoad logic to PluginManager
* fix some warnings
* handle exceptions properly
* remove ability to cancel, rename button to "hide" instead
* undo Dalamud.Service refactor for now
* warnings
* add explainer, show which plugins are still loading
* add some text if loading takes more than 3 minutes
* undo wrong CS merge
* Add IInternal/PublicDisposableService
Plugins are exposed interfaces that are not inherited from
`IDisposable`, but services implementing plugin interfaces often
implement `IDisposable`. Some plugins may try to call
`IDisposable.Dispose` on everything provided, and it also is possible to
use `using` clause too eagerly while working on Dalamud itself, such as
writing `using var smth = await Service<SomeService>.GetAsync();`. Such
behaviors often lead to a difficult-to-debug errors, and making those
services either not an `IDisposable` or making `IDisposable.Dispose` do
nothing if the object has been loaded would prevent such errors. As
`ServiceManager` must be the only class dealing with construction and
disposal of services, `IInternalDisposableService` has been added to
limit who can dispose the object. `IPublicDisposableService` also has
been added to classes that can be constructed and accessed directly by
plugins; for those, `Dispose` will be ignored if the instance is a
service instance, and only `DisposeService` will respond.
In addition, `DalamudPluginInterface` and `UiBuilder` also have been
changed so that their `IDisposable.Dispose` no longer respond, and
instead, internal functions have been added to only allow disposal from
Dalamud.
* Cleanup
* Postmerge fixes
* More explanation on RunOnFrameworkThread(ClearHooks)
* Mark ReliableFileStorage public ctor obsolete
---------
Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
- Rename `PluginLog`'s property to `Dalamud.PluginName` to match what `IPluginLog` is doing.
- Change `ModuleLog` to use `Dalamud.ModuleName` as its context property.
- Update the Console window to handle both changes.
- Add the ability to filter to only Dalamud module log messages.
Adds a new `IPluginLog` service to Dalamud, which provides scoped logging on a per-plugin basis. This improves log performance for plugins, and paves the way for per-plugin log levels.
* Plugins must opt in to enable verbose logging by setting `IPluginLog.MinimumLogLevel` to `LogEventLevel.Verbose`. This option is automatically enabled for dev plugins and is currently not persisted.
* All release plugins will default to `Debug` as their lowest allowed log level.
* This setting does not override the global log level set in Dalamud.
Adds the ability to send a log message to Serilog specifying a log level at runtime. This feature is primarily aimed at allowing developers to easily bridge disparate logging systems without hardcoding log level calls.
- Re-add the [PluginName] tag to plugin log messages
- Remove source prepending from the SerilogEventSink
- Force a filter refresh on enabling/disabling log filtering
- Convert ModuleLog to properly tag its messages with SourceContext
This commit adds first-pass support for more robust plugin log filtering. No changes were made that affect PluginLog's APIs nor log format. This change works by making use of Serilog's "SourceContext" property to attach plugin information to all log messages. The in-game log UI can then be used to filter based on this property.
Future expansions for this system include the ability to set different plugins to different log levels (something that already can technically be done, but requires those plugins be hard-coded through MinimumLevel.Override), creating new root loggers for each plugin (thereby giving plugin devs more control over their logging should they want to use it), plus other potential improvements in the way of adding context or rich information.
- Update PluginLog to attach a "SourceContext" property to all log messages.
- Tweak the SerilogEventSink to pass the original log event around.
- Suppress Info/Debug/Verbose exceptions from Troubleshooting reports.
- Fix the ConsoleWindow log filter to use _all_ filters, rather than just one.
- Add ConsoleWindow dropdown to select plugins to filter logs by
- Add support for multiple log levels to ConsoleWindow filtering