Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh debug tracing with timestamp



In the last episode (Apr 15), Bart Schaefer said:
> On Apr 14, 11:47pm, Paul Lew wrote:
> } Subject: zsh debug tracing with timestamp
> }
> } Any method to insert timestamp in front of the trace command turned on
> } by set -x?
> 
> Yes, if you're using 3.1.6 or later.  Just set PS4 using any of the usual
> prompt expansion escapes, e.g.:
> 
> % PS4=': %D %T ; '
> % set -x
> % sleep 5; echo hello
> : 01-04-15 12:43 ; sleep 5
> : 01-04-15 12:43 ; echo hello
> hello
> 
> If you need finer granularity, setopt promptsubst and use $SECONDS:

not needed; just use %D{%Y-%m-%d %H:%M:%S}, which will give you
seconds.

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author