Re: a trivial and complicated problem in TCL

Liste des GroupesRevenir à cl tcl 
Sujet : Re: a trivial and complicated problem in TCL
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.lang.tcl
Date : 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'

Date Sujet#  Auteur
12 Aug 24 * a trivial and complicated problem in TCL3aotto1968
12 Aug 24 +- Re: a trivial and complicated problem in TCL1Ralf Fassel
12 Aug 24 `- Re: a trivial and complicated problem in TCL1undroidwish

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal