Tcl Library Source Code

View Ticket
Login
Ticket UUID: 1113348
Title: No way for logproc to discover servicename
Type: Bug Version: None
Submitter: mic42 Created on: 2005-01-31 18:13:20
Subsystem: logger Assigned To: mic42
Priority: 5 Medium Severity:
Status: Open Last Modified: 2006-08-10 13:34:21
Resolution: None Closed By:
    Closed on:
Description:
Currently there is no way for a logproc to discover its
servicename.

Example:
set log [logger::init foo]
proc customized {txt} {
   puts "How shall i find my servicename with this
signature?: $txt"
}
${log}::logproc error customized

There is a workaround using the older logproc syntax
though.

set log [logger::init bar]
proc customized {service txt} {
   puts "Logging service $service : $txt"
}
${log}::logproc error txt {
   variable service
   ::customized $service $txt
}

The signature of the custom logproc should be enhanced
with the loglevel, the service and the text and
possible an args for future extensions.

Michael