Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging Improvements #10

Merged
merged 3 commits into from Aug 1, 2022
Merged

Logging Improvements #10

merged 3 commits into from Aug 1, 2022

Conversation

gbakeman
Copy link
Contributor

@gbakeman gbakeman commented Aug 1, 2022

Make both cosmetic and functional improvements to the way logging works in WinNUT. Notably:

  • Rename variables and functions so that they better communicate their purpose
  • Move variables within classes for better OOP design, where appropriate
  • Document some functions and behaviors
  • Move log files to their own subdirectory, and store them next to the executable when debugging.
  • Modified how logging controls behave in the Prefs GUI: more simple from a code standpoint, and verified functionality
  • Create more informative log entries

Will hopefully benefit #4 and others.

- Renamed WriteLogValue to WriteToFile to better communicate its purpose
- Disabled references to WinNUT_Globals.LogFilePath for better OOP design
- Add XML doc to LogTracing subrouting as best as I understand it
- (Also disabled updating the LogFilePath global variable in here, too)
- WinNUT_Globals:
  - Move AppData directory info to a Property, and return different values if debugging or not.
  - Logger object is now stored in globals, rathern than WinNUT.vb
- Logger.vb:
  - BaseFileName is now a const, LogFolder is shared and stored in a subdirectory
  - LogFile writing is now a property that handles setup and shutdown of logging
  - Actual logging setup is moved to its own subrouting, so the class constructor has very little to do.

- Updated/simplified/commented out unnecessary LogFile references.
- Pref_Gui: Simplified log controls, created a subrouting for log control enablement.
- WinNUT.vb:
  - Instantiate Logger at beginning of form load.
  - Relocated logtracing lines to appropriate locations.
  - Renamed local Logger object for events handling.
@gbakeman gbakeman added the enhancement New feature or request label Aug 1, 2022
@gbakeman gbakeman self-assigned this Aug 1, 2022
- Adjust spacing in connection error string
- Nut_Socket.vb: Enhanced error raising so Nut_Exceptions are passed as-is
- Handle NUT errors at the UPS level. Currently only informative logging is happening here, extra actions taken as a result yet.
@gbakeman gbakeman marked this pull request as ready for review August 1, 2022 23:33
@gbakeman gbakeman merged commit f74997f into Dev-2.1 Aug 1, 2022
@gbakeman gbakeman deleted the log-improvs branch August 1, 2022 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant