Sujet : Re: a trivial and complicated problem in TCL
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.lang.tclDate : 12. Aug 2024, 14:48:32
Autres entêtes
Message-ID : <ygattfpzwb3.fsf@akutech.de>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
* aotto1968 <
aotto1968@t-online.de>
| I use
>
| > pkg_mkIndex -verbose . {*}$libs
>
| to build a 'pkgIndex.tcl' file … GOOD
| NOW I want to redirect the "stderr" output (-verbose) to stdout ... BAD
>
| I can't figure out a "trivial" solution for this simple task IN tcl.
Looking at the code for pkg_mkIndex, it uses 'tclLog' for the 'verbose'
output. 'tclLog' itself is defined in init.tcl, with the explicit comment
# Define a log command (which can be overwritten to log errors
# differently, specially when stderr is not available)
if {[namespace which -command tclLog] eq ""} {
proc tclLog {string} {
catch {puts s $string}
}
}
So if you redefine
proc tclLog {string} {
catch {puts stdout $string}
}
prior to invoking pkg_mkIndex, it might "just work".
Haven'd tried it, so YMMV.
HTH
R'