justalemon / GGOV

Mod for GTA V that implements the HUD System and Features from Gun Gale Online
MIT License
12 stars 5 forks source link

Added lightweight logging class. #13

Closed NamStalker closed 5 years ago

NamStalker commented 5 years ago

Implemented lightweight logging class to log when the HUD is enabled or disabled. Created for stale issue #4

justalemon commented 5 years ago

I was thinking on ditching the custom logging idea. After all, a message is printed during the loading and abort/close in ScriptHookVDotNet2.log:

[19:27:41] [DEBUG] Instantiating script 'GGO.Singleplayer.Main+GGO' in script domain 'ScriptDomain_F9EE2610' ...
[19:27:44] [DEBUG] Started script 'GGO.Singleplayer.Main+GGO'.

The errors are going to end up in in the same file in the case of an exeption.

What do you think?

NamStalker commented 5 years ago

I would agree with you that for instantiation and errors, ScriptHookVDotNet2.log should suffice.

The only reason to keep a custom logger is if exception handling is implemented in an area and we want to log those errors without crashing the HUD. (I.e. when Images.GetWeaponImage() is called, if no resource is found to match the weapon name, it simply returns, but a custom logging class could return what weapon is missing and it could be more easily added.) But there are not many cases like this as of now.

justalemon commented 5 years ago

Yeah, once I start porting the mod to FiveM we are going to need per-player logging and related stuff.

I'm going to keep this open as a reminder.

justalemon commented 5 years ago

I have added a more or less clean logging class in daf517f8728c059ee4cc079e7c399e32723b5847 that prints the raw configuration values if the debug mode is enabled.