| Ticket UUID: | 1008797 | |||
| Title: | bad multiple calls to logging command in log::log | |||
| Type: | Bug | Version: | None | |
| Submitter: | eriklns | Created on: | 2004-08-13 16:25:15 | |
| Subsystem: | log | Assigned To: | andreas_kupries | |
| Priority: | 5 Medium | Severity: | ||
| Status: | Open | Last Modified: | 2004-08-26 22:55:25 | |
| Resolution: | None | Closed By: | ||
| Closed on: | ||||
| Description: |
When the text to log consists of multiple lines, this
results in calling the logging command as many times as
there are lines.
After inspecting the code, I saw that around line 672
(in tcllib release 1.6), a change has been introduced
to correctly handle log texts that consist of multiple
lines.
The relevant code snippet is:
foreach line [split $text \n] {
eval [linsert $cmd end $level $line]
}
This causes the logging command to be called repeatedly
for a single log text (which did not happen in the log
extension that resided in tcllib release 1.3 for example).
| |||
| User Comments: |
andreas_kupries added on 2004-08-26 22:55:25:
Logged In: YES user_id=75003 We never specified in the beginning how much a call to log::log should write, and the interface to the log command itself was unspecified in this regard as well. I'll have to think more about this. eriklns added on 2004-08-13 23:53:11: Logged In: YES
user_id=113903
Good or bad is of course a matter of taste.
I expect a call to [log:log] log a _single event_ to the log
file. If this expectation is wrong than please indicate what
I should expect.
If the event to be logged happens to be annotated with a
text containing multiple lines, I end up with a log file
whose (distorted) format implies multiple events.
Of course, I may have been abusing [log::log] all the time ....
Example:
An app walks into a bgerror (a single event ! ), which is
captured and logged as follows:
proc bgerror {} {
global errorInfo
.....
# note that $errorInfo has multiple lines ...
log::log $level $errorInfo
.....
}
andreas_kupries added on 2004-08-13 23:35:20: Logged In: YES user_id=75003 How is having one call per line bad ? This means that each line is (correctly) prefixed with the level, for example (if using the standard proc). | |||
Home
Blog
Docs
Downloads
Tickets
Timeline
Branches
Tags
Wiki