[Home]

Summary:ASTERISK-09767: [branch] Add milliseconds to CLI display and make the -T option work as advertised
Reporter:Frank Sautter (xylome)Labels:
Date Opened:2007-06-27 12:13:46Date Closed:2007-07-18 15:49:10
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) milliseclog.patch
Description:currently adding -T to the commandline options of asterisk does not work as advertised (displaying the time on each line of CLI output), which is fixed with this patch.

i also found it useful having milliseconds on the CLI when debugging timecritical things.

this patch introduces '%#' to "dateformat" in the logger.conf file which is replaced by the miliseconds.

this patch also brings a new string function "ast_string_replace" which allows (hopefully) secure search and replace operations on strings
Comments:By: Joshua C. Colp (jcolp) 2007-06-27 14:57:59

I've put the -T fix in as of revision 72233 but left the rest for now until we get some more feedback or someone takes a deeper look.

By: Tilghman Lesher (tilghman) 2007-06-27 15:22:26

Instead of doing string replacement, I wonder if the better action might be to revamp some of the datetime functions:

ast_localtime's first argument as 'struct timeval *' instead of 'time_t *'.
ast_localtime's second argument as 'struct ast_tm *' instead of 'struct tm *'.
New function ast_strftime which takes a 'struct ast_tm *' instead of 'struct tm *'.

This would enable us to do milliseconds transparently for all cases which need dates and times, without trying to code a hack around the lack of milliseconds in time structures.

By: Frank Sautter (xylome) 2007-06-27 15:39:26

that's a good idea (in fact my scope was to just solve my little wish).

tomorrow i'll try to take a closer look on your recomendation and see what i can do.

By: Tilghman Lesher (tilghman) 2007-07-07 11:15:24

I've created the team/group/ast_strftime branch for the conversion of internal timestamps to be accurate to the fraction of a second, by using struct timeval in place of time_t.

By: Tilghman Lesher (tilghman) 2007-07-18 15:49:10

Branch ast_strftime has been merged into trunk as of revision 75706.