Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Expect and log_user

1,064 views
Skip to first unread message

dba...@norspam.com

unread,
Jul 28, 2005, 8:37:13 AM7/28/05
to
Hello,

Does someone know if it is possible to define
through expect the logging of the session per spawn_id.
The "log_user" command seems to switch globally
the logging on or off.

------------------------------
David Bariod
For email replace spam by tel

Don Libes

unread,
Jul 28, 2005, 4:20:55 PM7/28/05
to
Yes, log_user was only intended as a crude type of mechanism. If you
want finer control, take charge of all output yourself. The book
shows an example - by tracing expect_out(spawn_id), it writes the
output of each spawned proc to a different file. You can easily adapt
that idea to what you're interested in.

Don

Sektor van Skijlen

unread,
Jul 29, 2005, 10:20:18 AM7/29/05
to
Dnia 28 Jul 2005 16:20:55 -0400, Don Libes skrobie:

> Yes, log_user was only intended as a crude type of mechanism. If you
> want finer control, take charge of all output yourself. The book
> shows an example - by tracing expect_out(spawn_id), it writes the
> output of each spawned proc to a different file. You can easily adapt
> that idea to what you're interested in.

Don, please...

Could you show somewhere on the net an example that shows spawning two
separate processes and log the session with each of them into its separate
file?

About three times did I ask about it here and no procedure for that succeeded.

--
// _ ___ Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl>
\\ L_ |/ `| /^\ ,() <ethourhs(O)wp.pl>
// \_ |\ \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx
"Java does not have pointers!"

Don Libes

unread,
Jul 29, 2005, 5:00:31 PM7/29/05
to
Sektor van Skijlen <etho...@pl.wp.spamu.lubie.nie.invalid> writes:

> Dnia 28 Jul 2005 16:20:55 -0400, Don Libes skrobie:
> > Yes, log_user was only intended as a crude type of mechanism. If you
> > want finer control, take charge of all output yourself. The book
> > shows an example - by tracing expect_out(spawn_id), it writes the
> > output of each spawned proc to a different file. You can easily adapt
> > that idea to what you're interested in.
>
> Don, please...
>
> Could you show somewhere on the net an example that shows spawning two
> separate processes and log the session with each of them into its separate
> file?
>
> About three times did I ask about it here and no procedure for that succeeded.

Probably because it's in the Expect book (page 408) and it's been
there for years and everyone (including me) is just too lazy to wrap
it up into an actual script :-P

Don

dba...@norspam.com

unread,
Aug 2, 2005, 4:01:21 AM8/2/05
to

On Thu, 28 Jul 2005, Don Libes wrote:

> Yes, log_user was only intended as a crude type of mechanism. If you
> want finer control, take charge of all output yourself. The book
> shows an example - by tracing expect_out(spawn_id), it writes the
> output of each spawned proc to a different file. You can easily adapt
> that idea to what you're interested in.
>

Ok thanks for the info.
In fact I'm trying to increase post-mortem analysis
of expect session in case of timeout, is there also
a way form tcl to programmatically access to the
internal manipulation of the expect buffers
(as presented by the command exp_internal).
I would like, for example, keep the several last pattern
match per spawn id, and be able to dump them in
case of unexpected failure (timeout/eof/...)

Don Libes

unread,
Aug 3, 2005, 3:24:10 PM8/3/05
to
dba...@norspam.com writes:

You get it using: expect -notransfer *
Crude but it works.

Don

0 new messages