Describe The Bug
Stracker's Loader console seems to not be thread-safe/fast enough. Calling Log.Info (or any other logging function) from different threads and/or too fast causes 2 side effects:
- Lines are leaking into each other.

- Green Color of the
[ TIME ] is leaking into the message.

If I hot-reload the plugin it will go even crazier.

I can see how this can become a bigger issue when there are multiple plugins trying to log stuff.
FileSystemWatcher fires Changed event twice, this is known bug/feature of it (-> Remarks), and a good way to reproduce the issue.
As a side note, Console.WriteLine() has a similar bug, even thou it is supposed to be thread-safe. StackOverflow post.
To Reproduce
- Make a plugin log stuff from different threads at the same time or have a
FileSystemWatcher with Change event;
- Launch the game;
- Hot-reload the plugin;
- Observe.
Expected Behavior
Console shouldn't behave like that. The Logger should be made thread-safe and, perhaps, buffered and throttled a little bit? While I can do that plugin-side, I think that the issue should be addressed on SPL level. Not sure how to fix that exactly thou, since I can see how buffering/throttling can lead to an overflow quickly if a plugin tries to log caught exceptions repeatedly.
Priority
Suggested P4 Priority. The issue is only visual and doesn't affect the functionality of SPL or plugins.
PC Specs
Show/Hide
Motherboard: Asus ROG Strix Z390-H Gaming
CPU: Intel Core i9-9900k
RAM: 32 GB 3200MHz
GPU: Nvidia GeForce RTX 3090 Ti
System and Game SSD: Samsung SSD 970 EVO Plus NVMe M.2 1TB
Plugin Repo SSD: Western Digital Blue SATA M.2 2280 2TB
Environment
Show/Hide
OS: Window 10 Enterprise Version 22H2 (OS Build 19045.3996)
Monster Hunter: World: v15.21.00
SharpPluginLoader: pre-v0.0.4.0 (bea1094)
Nvidia Drivers: v551.52
Game Display Settings
Show/Hide
DirectX 12 API: On
Screen Mode: Borderless Window
Resolution Settings: 2880x1620 (Supersampled down to 1920x1080)
Aspect Ratio: Wide (16:9)
Nvidia DLSS: Off
FidelityFX CAS + Upscaling: Off
Frame Rate: No Limit
V-Sync: On
Game Advanced Graphics Settings
Show/Hide
Image Quality: High
Texture Quality: High Resolution Texture Pack
Ambient Occlusion: High
Volume Rendering Quality: Highest
Shadow Quality: High
Capsule AO: On
Contact Shadows: On
Anti-Aliasing: Off
LOD Bias: High
Max LOD Level: No Limit
Foliage Sway: On
Subsurface Scattering: On
Screen Space Reflection: On
Anisotropic Filtering: Highest
Water Reflection: On
Snow Quality: High
SH Diffuse Quality: High
Dynamic Range: 64-bit
Motion Blur: On
DOF (Depth of Field): On
Vignette Effects: Normal
Z-Prepass: On
Mods and External Tools:
Show/Hide
Additional Context
Plugin Repo
Describe The Bug
Stracker's Loader console seems to not be thread-safe/fast enough. Calling
Log.Info(or any other logging function) from different threads and/or too fast causes 2 side effects:[ TIME ]is leaking into the message.If I hot-reload the plugin it will go even crazier.
I can see how this can become a bigger issue when there are multiple plugins trying to log stuff.
FileSystemWatcherfiresChangedevent twice, this is known bug/feature of it (-> Remarks), and a good way to reproduce the issue.As a side note,
Console.WriteLine()has a similar bug, even thou it is supposed to be thread-safe. StackOverflow post.To Reproduce
FileSystemWatcherwithChangeevent;Expected Behavior
Console shouldn't behave like that. The
Loggershould be made thread-safe and, perhaps, buffered and throttled a little bit? While I can do that plugin-side, I think that the issue should be addressed on SPL level. Not sure how to fix that exactly thou, since I can see how buffering/throttling can lead to an overflow quickly if a plugin tries to log caught exceptions repeatedly.Priority
Suggested P4 Priority. The issue is only visual and doesn't affect the functionality of SPL or plugins.
PC Specs
Show/Hide
Motherboard: Asus ROG Strix Z390-H GamingCPU: Intel Core i9-9900kRAM: 32 GB 3200MHzGPU: Nvidia GeForce RTX 3090 TiSystem and Game SSD: Samsung SSD 970 EVO Plus NVMe M.2 1TBPlugin Repo SSD: Western Digital Blue SATA M.2 2280 2TBEnvironment
Show/Hide
OS: Window 10 Enterprise Version 22H2 (OS Build 19045.3996)Monster Hunter: World: v15.21.00SharpPluginLoader: pre-v0.0.4.0 (bea1094)Nvidia Drivers: v551.52Game Display Settings
Show/Hide
DirectX 12 API: OnScreen Mode: Borderless WindowResolution Settings: 2880x1620 (Supersampled down to 1920x1080)Aspect Ratio: Wide (16:9)Nvidia DLSS: OffFidelityFX CAS + Upscaling: OffFrame Rate: No LimitV-Sync: OnGame Advanced Graphics Settings
Show/Hide
Image Quality: HighTexture Quality: High Resolution Texture PackAmbient Occlusion: HighVolume Rendering Quality: HighestShadow Quality: HighCapsule AO: OnContact Shadows: OnAnti-Aliasing: OffLOD Bias: HighMax LOD Level: No LimitFoliage Sway: OnSubsurface Scattering: OnScreen Space Reflection: OnAnisotropic Filtering: HighestWater Reflection: OnSnow Quality: HighSH Diffuse Quality: HighDynamic Range: 64-bitMotion Blur: OnDOF (Depth of Field): OnVignette Effects: NormalZ-Prepass: OnMods and External Tools:
Show/Hide
Additional Context
Plugin Repo