-
Notifications
You must be signed in to change notification settings - Fork 55
Log Refactor #654
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
base: dev
Are you sure you want to change the base?
Log Refactor #654
Conversation
…atabase can feed the log back.
… events in there, too.
@josef-poetzl I have this just about finished up; though, I'm having trouble getting I did discover that the LogTable in the addin (when the addin is loaded as an addin) DOES keep the data from operation to operation, which is a neat thing, but I can't seem to get the thing exported correctly. I even went so far as to use the |
Maybe use a querydef (in the FE) that accesses the table in the add-in? The ADODB XML export is probably not an alternative, is it? By the way: don't forget that the data is gone when you update the add-in. |
Correct, it's actually desired; in actuality, I'm not sure I even wanted it to persist between sessions (to keep it lightweight), but that's another discussion. I don't know if we want the log to be muddied between different files being built/export, keeping the log to a single project is probably ok long term though. Depending on how long it takes to import/[do operation]/export to project log it may end up being more efficient to simply keep a per-operation log like is done now.
Hmm, I'll give that a shot; I was hoping to use a consistent XML export routine in case we ended up needing to sanitize it like we do with the tables; this gives the advantage of using the same XML parsing tools used by the addin for the built db and therefore a consistent XML look. |
Figured it out! was what I needed; it's also stupid fast; exporting about 900 records in a half second. I'm going to tidy it up and push up the finished up code; this first version will export the log, clear out the log after each operation so it's not persisted (as is the case now). If this works well I'll add some options to allow the log to be appended to the existing XML file or simply continue as-is (the current system). If that works well, the next step will be to expose the new log class externally via the API (so that the pre/post called functions can log their state if desired). |
this is guestimation; I haven't timed it, I suspect it's faster than that, I just wanted to point out that this operation doesn't take any more time than the current log saving mechanism. |
…any connected file. Also correct to clear out the correct log table.
ooh, unintended upside: because this class now relies on a table in the addin, if you somehow crash the addin/MS Access the log table remains and it will export next time you run an operation. This has been nice when I've caused a bug and needed to force close but don't know what went wrong during the export. |
…with the in-use parameter
…e already logged before exporting.
… operatino types on same instance) you get a different GUID per operation.
Alright! @josef-poetzl, @joyfullservice , @bclothier : This is ready for looksee! Logs are now stored in a separate file; they are persisted and if Access crashes during an operation, the logs will be retained...probably.
Each operation has a specific key, and you should be able to set persistence or not of the logs in your options. If you build two things from the same computer at once, each Log from the specific operation SHOULD be loaded correctly and not interfere. Take a look, let me know what you think; I think the ability to set separate levels and have them log/not log based on the level is pretty sick, personally. |
closes #673 too |
Any other comments/reviews @josef-poetzl @joyfullservice @bclothier ? IIRC if you started a review you have to complete it before I can see any comments. |
No further comments from me. Looks good but I have not tested the functionality yet. |
Thanks @bclothier! hopefully it runs as well on your machine as it did on mine.
|
This closes #507, #673, #666
First to demonstrate the log speed (this new one is FAST), and to maintain the functionality of the existing code (a whole-system refactor is not super duper desirable), and to incorporate the remaining elements of the log tool.
Remaining elements:
Log Level
(currently natively part of the new log class, but is not implemented in options) (Added to options)DisplayLogLevel
ShowDebug
ShowDebug
as an option.ShowDebug
is used 32 times. Suggest setting those use cases to an event level ofeelDebugTrace
,eelDebugEvent
, oreelDebugInfo
If Options.DisplayLogLevel < eelNoError Then Options.ShowDebug = True
(this seems the easiest way to handle it, actually)LogLevel
andDisplayLogLevel
after Options are loadedclsErrorInfo
)Show Debug
Checkbox to dropdown option forDisplayLogLevel
.LogLevel
This first PR is to build out others, create discussion, and have some review before we go forth. I've implemented it here as a ridealong to demonstrate feasibility and speed impacts (in my testing, it did not impact speed of export or build at all) and provided a ton more information and time stamp detail than I had.
The log also allows us to set the log level and thus keep the log a lot cleaner when users don't need ultragranular detail. For instance, if you're troubleshooting an export, you can set the log to log everything, even Debug Tracing. If you're in production, and you just want to know if warnings or more happen, you set it to warning.
Let me know what you all think!
If this initial implementation looks ok, I will refactor the rest of the
clsLog2
class into the new one, but wanted to start off by showing a proof of concept.@joyfullservice @josef-poetzl @bclothier anyone else?