Skip to content

Conversation

gbakeman
Copy link
Contributor

@gbakeman gbakeman commented Nov 23, 2022

Judging from my Debugging output folder, it looks like generating the application's data directory has been broken since after November 11. Not quite sure what commit did it, but here's a summary of what's in this PR:

  • General reorganization of the WinNUT_Globals Module.

    • Altered some constants to be more consistent, made shortcut properties and general static strings defined within the module itself.
    • As a result, the Init_Globals function is one line.
    • This calls the new GetAppDirectory function. It returns the best directory for storing application data (currently Logs only), starting with the specified string as the directory wanted. If that fails (i.e debug build in a read-only directory, or appdata directory is not available for some reason) then we'll use the user's default temp directory.
  • Logger improvements

    • Standardize datetime format
    • Print some output when initializing the log
    • Broke out line formatting
    • Fixed data directory naming and location
  • Should close Log files still being saved in system root folder #61.

Trying to fix log files ending up in the C:\ directory. SetupAppDirectory is now private, and named GetAppDirectory. This is now strictly a function that tries to create the base directory and return it. It will also fallback to the temp directory if necessary, and hopefully log the error. The Globals method has also generally been rearranged and cleaned up with respect to logging and directories.
To vastly simplify the Init_Globals routine, I've moved some shortcut properties/other static information into the variable definitions area of the module.
Also instantiate the Logger class right away so it's available to take calls ASAP.
Any path-related constants only represent the directory that the WinNUT-Client data container directory goes in. The WinNUT directory will be appended later on.
@gbakeman gbakeman added bug Something isn't working enhancement New feature or request labels Nov 23, 2022
@gbakeman gbakeman added this to the 2.2 Stable Release milestone Nov 23, 2022
@gbakeman gbakeman linked an issue Nov 23, 2022 that may be closed by this pull request
- Tried to use default date/time formats when possible (not sure it actually affects anything though)
- Bolstered initialization routine for logging to provide better info and past events sitting in the buffer.
- Broke out log line formatting into its own function
- Return the data directory name back to what it was before.
@gbakeman gbakeman merged commit e2e72c0 into Dev-2.2 Nov 28, 2022
@gbakeman gbakeman deleted the 61-logfile_roundup branch November 28, 2022 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log files still being saved in system root folder
1 participant