TT#111357 add microseconds to file name patterns

closes #1195
closes #1150

Change-Id: Ic6ea7b40ff1f26e92ab2d50adc50776f72a10616
pull/1218/head
Richard Fuchs 4 years ago
parent a8a0adb759
commit 7f579ac2db

@ -84,11 +84,13 @@ static void create_parent_dirs(char *dir) {
output_t *output_new(const char *path, const char *call, const char *type) {
// construct output file name
time_t now = time(NULL);
struct timeval now;
struct tm tm;
localtime_r(&now, &tm);
const char *ax = call;
gettimeofday(&now, NULL);
localtime_r(&now.tv_sec, &tm);
GString *f = g_string_new("");
for (const char *p = output_pattern; *p; p++) {
if (*p != '%') {
@ -127,6 +129,9 @@ output_t *output_new(const char *path, const char *call, const char *type) {
case 'S':
g_string_append_printf(f, "%02i", tm.tm_sec);
break;
case 'u':
g_string_append_printf(f, "%06li", (long) now.tv_usec);
break;
case '0':
case '1':
case '2':

@ -183,6 +183,10 @@ was created) and are the same as the format sequences supported by L<date(1)>
or L<strftime(3)> (year, month, day, hours, minutes, and seconds,
respectively).
=item B<%u>
Microseconds, expanded to 6 digits (B<000000> through B<999999>).
=item B<%>I<INT>
References a prefix from the call ID of the given length. If this format

Loading…
Cancel
Save