| Description: |
As of current, the argument for ${log}::logproc must be a command name. This makes overriding logprocs for all levels difficult if a dispatcher command is to be used. Although a wrapper procedure can be built with ::apply, supporting command prefixes would make it easier to provide additional data to the logprocs. See, for example:
foreach level [::logger::levels] {
log::logproc $level \
[list ::apply [list {level} { msg $level; } [::namespace current]] $level];
}
If ${log}::logproc supported command prefixes, it could be rewritten as follows:
foreach level [::logger::levels] {
log::logproc $level \
[list [::namespace current]::msg $level];
}
This change would also support the use case http://core.tcl.tk/tcllib/tktview?name=1113348fff, as the service name could be passed as a parameter.
|