-
Notifications
You must be signed in to change notification settings - Fork 8
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
Is there a way to add information to the error/warning #52
Comments
Great idea! The "default" logging of Do you have more use cases for additional text to be added since I would "inject" the process ID |
My PR has functioning example code of adding this to tryCatchLog. It was pretty straightforward to do at the tryCatchLog level. I was trying to figure out how to inject via |
Thanks for doing the work and sending a PR! I have done a first short review (just for myself so far) to understand your needs. Just to be sure I understand your requirements right:
BTW: I can remember I already had an issue regarding process IDs when writing dump files: #39 PS: Tomorrow I will add examples on how to write the PID into the logging output by using just logging frameworks... |
For my use case the PID is useful, but the ability to add some type of generic text is what I really need. I can see a tonne of reasons for this and how it might be better than just a PID.
In the case above, knowing the pid is useful, but knowing the value of
Now the error message gives you a callstack AND a debug start point which is perfect for paralllel operations where the things that fail are always edgecases that you only find during processing. |
THX I see + you convinced me :-) Give me a few days to settle
|
Regarding
Output:
|
I think it's important to remember that the log is updated concurrently by tasks in parallel execution. So your info logging may happen interstitially with other task messages. This would work in sequential exectution but it would be pretty unreliable for a fast task queue. It really needs to be appened to the message for it to work. Let's take 3 processes where 1 is successful and 2 and 3 error but take different amounts of concurrent time. You log might look like this:
|
BTW: For a list of R logging frameworks and their popularity see: #42 |
I used your analysis to just "go with fultile.logger"! Thanks for that. |
Regarding "interstitial" logging: THX for mentioning this use case, it is a key argument to have an "ID" in the |
Implemented via PR #53 into master for final user tests. RfC. |
@1beb Since today this feature is contained in the new CRAN version (took very long, sorry!) |
Great package!
I'm wondering if there's an easy way to add additional information to the error / warning message. Here's some psuedo code for example:
And the pseudo although desired result would be:
The text was updated successfully, but these errors were encountered: