[vlc-devel] Re: [PATCH] timestamp for log output and logger interface.

R. Bernstein rocky at panix.com
Sun Oct 24 19:46:43 CEST 2004


=?iso-8859-15?Q?Cl=E9ment?= Stenac writes:
 > That can be a nice feature, and I don't think I have any comment on the
 > code (is localtime_r portable ?)

The Solaris manual page for this is I think informative about
localtime_r (gmttime_r, etc):

       The four functions asctime(), ctime(), gmtime() and localtime()
       return a pointer to static data and hence are not thread-safe.
       Thread-safe versions asctime_r(), ctime_r(), gmtime_r() and
       localtime_r() are spec- ified by SUSv2, and available since
       libc 5.2.5.

       The glibc version of struct tm has additional fields

              long tm_gmtoff;           /* Seconds east of UTC */
              const char *tm_zone;      /* Timezone abbreviation */

       defined when _BSD_SOURCE was set before including <time.h>.
       This is a BSD extension, present in 4.3BSD-Reno.

  CONFORMING TO
       SVID 3, POSIX, BSD 4.3, ISO 9899

 > But I would prefer to have this as a config option, and choose to
 > enable or disable the timestamp.

Or one could do what I did to add timestamps in the history file in my
patches to bash 2.05b to support debugging (and now part of bash
3.0). There, I had a environment variable that was used by strftime()
to give the desired time format you want. So if you want to disable
timestamps altogether, just set that variable to the null
string. Here, instead of "enviroment variable" substitute
"configuration variable"

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list