Commit graph

56 commits

Author SHA1 Message Date
goaaats
defa49865c Fix warning 2025-02-27 21:37:05 +01:00
KazWolfe
a656fefb2b
feat: Allow /xldev to disable Safe Mode (#2166)
- 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
2025-01-09 22:01:46 +01:00
Kaz Wolfe
621fd17e1d
Expose Serilog API to plugins 2024-09-29 10:46:12 -07:00
KazWolfe
0c8c4bfdbf
chore: Remove the [InterfaceVersion] attribute (#1844) 2024-06-16 13:01:17 +02:00
github-actions[bot]
4e331b1d85 Merge remote-tracking branch 'origin/master' into apiX-rollup 2024-06-08 23:34:08 +00:00
goat
16f0fb76f4 add basic console system for debugging 2024-06-07 01:30:42 +02:00
Soreepeong
0d7c0a0375 Merge remote-tracking branch 'upstream/apiX' into feature/itextureprovider-updates 2024-06-04 23:54:38 +09:00
Soreepeong
8c7771bf7d Merge branch 'apiX' into feature/itextureprovider-updates 2024-05-12 22:17:32 +09:00
Kaz Wolfe
b32ed39826
Merge branch 'refs/heads/master' into apiX
# Conflicts:
#	Dalamud/Game/Libc/LibcFunction.cs
#	Dalamud/Game/Libc/LibcFunctionAddressResolver.cs
#	Dalamud/Game/Libc/OwnedStdString.cs
#	Dalamud/Game/Libc/StdString.cs
#	Dalamud/Interface/UiBuilder.cs
2024-04-28 11:54:54 -07:00
goat
448b0d16ea
Add "loading dialog" for service init, unify blocking logic (#1779)
* 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
2024-04-21 17:28:37 +02:00
Kaz Wolfe
3b8ef2c8e8
chore: Remove static PluginLog
- API 10 deprecation
2024-04-20 10:57:59 -07:00
github-actions[bot]
4abb3535fa Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-16 16:02:57 +00:00
srkizer
87b9edb448
Add IInternal/PublicDisposableService (#1696)
* 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>
2024-03-16 15:58:05 +00:00
Soreepeong
ba51ec52f5 Better tex load cancellation handling 2024-02-28 17:43:24 +09:00
github-actions[bot]
5fbba87e59 Merge remote-tracking branch 'origin/master' into net8-rollup 2024-02-11 18:20:47 +00:00
goat
f338c470e2
Merge pull request #1614 from goaaats/wpid_profiles
Use WorkingPluginId as identifier for plugins, take 2
2024-01-22 17:23:47 +01:00
Soreepeong
dd5cbdfd5d IFontAtlas API9 compat: support reading GameFontHandle.ImFont during UiBuilder.After/BuildFonts 2024-01-21 00:15:12 +09:00
goaaats
d827151ee5
add icon for dev plugins 2024-01-18 22:21:37 +01:00
goaaats
b446fcc191
merge 2024-01-18 21:51:18 +01:00
github-actions[bot]
de584c8fa0 Merge remote-tracking branch 'origin/master' into net8-rollup 2023-11-28 21:55:56 +00:00
srkizer
7a0de45f87
Miscellaneous improvements (#1537) 2023-11-26 22:58:26 +01:00
goat
f8bd6d20ef
chore: remove all MonoMod hooks for now 2023-11-14 20:28:36 +01:00
goat
6f99cfe48c
fix: ScopedPluginLogService should be internal 2023-09-30 01:17:27 +02:00
goat
e9e234b340
fix: actually use the correct path when setting up vfs, fix warnings
use paramref instead of see

fix warnings
2023-09-29 18:59:01 +02:00
goat
2119d08926
fix warnings 2023-09-23 11:18:20 +02:00
Kaz Wolfe
d29422bc50
Add IPluginLog#Info
- Shorthand for information log lines, because typing out `Information` is too much.
2023-09-22 23:22:59 -07:00
Kaz Wolfe
4f8de2e205
Obsolete (static) PluginLog for future removal
- Mark PluginLog as obsoleted and pending removal, encouraging users to switch to IPluginLog.
- Remove internal references to PluginLog.
2023-09-22 17:01:10 -07:00
goat
a9f6d6d104
chore: ModuleLog fmt objects may be nullable 2023-09-21 19:04:08 +02:00
goat
5809cf5d7c
chore: make all services with interfaces internal 2023-09-17 21:09:00 +02:00
Kaz Wolfe
764e0a81b7
Fix log filtering with IPluginLog
- 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.
2023-09-09 15:21:05 -07:00
KazWolfe
8c51bbf0f8
Add Scoped Plugin Log Service (#1341)
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.
2023-09-07 17:58:41 +00:00
goat
bfbfe8c918
chore: ModuleLog.Error() exception can be nullable 2023-08-12 12:03:45 +02:00
goat
b901ad5aff
fix: move log retention out of EntryPoint.cs, redo retention behaviour for release 2023-06-19 19:53:05 +02:00
goat
166301f56f
fix warnings in Dalamud 2023-06-09 23:38:13 +02:00
goat
daa9f72218
IOC: scoped/on-demand services (#1120) 2023-05-21 22:43:28 +02:00
Kaz Wolfe
4f3727c78b
chore: Convert Exception to nullable in PluginLog
Allows specifying Exception as a nullable parameter to various Log calls where an Exception may or may not be present in the caller.
2023-02-10 22:37:33 -08:00
Kaz Wolfe
d57eba7f63
feat: Add LogRaw to PluginLog
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.
2023-02-10 22:36:34 -08:00
goat
987ff8dc8f
chore: convert Dalamud to file-scoped namespaces 2022-10-29 15:23:22 +02:00
Kaz Wolfe
5dd883db25
Fix missing plugin names in log, filter quirk
- 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
2022-09-10 14:53:44 -07:00
Kaz Wolfe
abecf2ffe4
Add Per-Plugin Log Filtering Support
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
2022-08-23 21:36:55 -07:00
kizer
716736f022
Improvements (#903) 2022-06-29 11:51:40 +02:00
kizer
3369f569fb
Add call-on-services-ready attribute for service methods, and fix scene nullability (#900) 2022-06-26 18:49:34 +02:00
kizer
8e7f370ddd
Load services asynchronously whenever possible (#893) 2022-06-24 22:12:51 +02:00
goat
96ed22534c
chore: fix some warnings, cleanup 2022-04-25 20:04:17 +02:00
goat
1561fbac00
Revert "refactor(Dalamud): switch to file-scoped namespaces"
This reverts commit b5f34c3199.
2021-11-18 15:23:40 +01:00
goat
b5f34c3199
refactor(Dalamud): switch to file-scoped namespaces 2021-11-17 19:42:32 +01:00
Raymond
5380141d76 Prune tasks from the infinite task list 2021-11-04 09:25:16 -04:00
Raymond
edc38bae5e bail on tasktracker hook error 2021-11-04 09:25:16 -04:00
Raymond
13b7a116b8 Fix taskTracker collection modified errors 2021-10-17 22:01:03 -04:00
goaaats
79cc68a4ff
Merge pull request #649 from daemitus/misc 2021-10-18 02:16:53 +02:00