You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to stream some content in a unique record.
I am using logbook in a project for great benefit, thanks.
In this project, we are spawning bash script processes and getting the stdout/sderr logs of those processes.
At the moment we are keeping all stdout/stderr lines in a string buffer (StringIO) and then dumping everyting in a log book record at the end of the process execution. This is fine but some processes are taking several minutes and during that time, I am blind as I have based all the logging on logbook.
Is there a simple way to get the corresponding logbook string buffer in that case and continue writing in the file ?
Indeed to avoid poluting the reporting, we would like to have all the script outputs contained in one record ?
So to sum up I would in particular case to write within the same record with multiple write message call and not a unique one as it is currently available. Is it possible with a bit of development. Is there an example ?
Many thanks in advance.
The text was updated successfully, but these errors were encountered:
Assuming your output is line-based, the right thing to do is emit the lines one-by-one, but that would make the log slightly harder to read. Another option is to separate that output to a separate log file
Yes it is line base by I do not want to have a date and message type for each line. I would like to also avoid using another file if possble. is there a way to have access to the string buffer of logbook and write into it ? Then when ready call a method to release and write the message in the log file with just one date ?
If not I will continue doing as I do now, buffering everything and write all the lines in one logbook message at the end once the process has exited.
I don't fully understand what you're suggesting.... If you had access to the handler's internal stream you would be doing essentially the same thing - interleaving your output lines along with the "regular" log lines... Can you scribble a suggested API you have in mind?
Is there a way to stream some content in a unique record.
I am using logbook in a project for great benefit, thanks.
In this project, we are spawning bash script processes and getting the stdout/sderr logs of those processes.
At the moment we are keeping all stdout/stderr lines in a string buffer (StringIO) and then dumping everyting in a log book record at the end of the process execution. This is fine but some processes are taking several minutes and during that time, I am blind as I have based all the logging on logbook.
Is there a simple way to get the corresponding logbook string buffer in that case and continue writing in the file ?
Indeed to avoid poluting the reporting, we would like to have all the script outputs contained in one record ?
So to sum up I would in particular case to write within the same record with multiple write message call and not a unique one as it is currently available. Is it possible with a bit of development. Is there an example ?
Many thanks in advance.
The text was updated successfully, but these errors were encountered: