Tcl Library Source Code

View Ticket
Login
2015-12-04
15:40 • Ticket [751707e0ae] logger::logproc should accept command prefixes status still Open with 3 other changes artifact: 548dc892b4 user: aku
11:30 • New ticket [751707e0ae]. artifact: 8fc8b71fc4 user: anonymous

Ticket UUID: 751707e0ae7811aaa48d11251b036f2fb11d9948
Title: logger::logproc should accept command prefixes
Type: RFE Version: 0.9.3
Submitter: anonymous Created on: 2015-12-04 11:30:49
Subsystem: logger Assigned To: schlenk
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2015-12-04 15:40:26
Resolution: None Closed By: nobody
    Closed on:
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.