@ -746,7 +746,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
if ( level ! = __LOG_VERBOSE ) {
if ( level ! = __LOG_VERBOSE ) {
sprintf ( linestr , " %d " , line ) ;
sprintf ( linestr , " %d " , line ) ;
snprintf ( buf , sizeof ( buf ) , ast_opt_timestamp ? " [%s] %s[%ld]: %s:%s %s: " : " %s %s[%ld]: %s:%s %s: " ,
snprintf ( buf , sizeof ( buf ) , " [%s] %s[%ld]: %s:%s %s: " ,
date ,
date ,
term_color ( tmp1 , levels [ level ] , colors [ level ] , 0 , sizeof ( tmp1 ) ) ,
term_color ( tmp1 , levels [ level ] , colors [ level ] , 0 , sizeof ( tmp1 ) ) ,
( long ) GETTID ( ) ,
( long ) GETTID ( ) ,
@ -763,7 +763,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
/* File channels */
/* File channels */
} else if ( ( chan - > logmask & ( 1 < < level ) ) & & ( chan - > fileptr ) ) {
} else if ( ( chan - > logmask & ( 1 < < level ) ) & & ( chan - > fileptr ) ) {
int res ;
int res ;
snprintf ( buf , sizeof ( buf ) , ast_opt_timestamp ? " [%s] %s[%ld]: " : " %s %s[%ld] %s: " , date ,
snprintf ( buf , sizeof ( buf ) , " [%s] %s[%ld] %s: " , date ,
levels [ level ] , ( long ) GETTID ( ) , file ) ;
levels [ level ] , ( long ) GETTID ( ) , file ) ;
res = fprintf ( chan - > fileptr , buf ) ;
res = fprintf ( chan - > fileptr , buf ) ;
if ( res < = 0 & & buf [ 0 ] ! = ' \0 ' ) { /* Error, no characters printed */
if ( res < = 0 & & buf [ 0 ] ! = ' \0 ' ) { /* Error, no characters printed */
@ -862,6 +862,8 @@ void ast_verbose(const char *fmt, ...)
localtime_r ( & t , & tm ) ;
localtime_r ( & t , & tm ) ;
strftime ( date , sizeof ( date ) , dateformat , & tm ) ;
strftime ( date , sizeof ( date ) , dateformat , & tm ) ;
datefmt = alloca ( strlen ( date ) + 3 + strlen ( fmt ) + 1 ) ;
datefmt = alloca ( strlen ( date ) + 3 + strlen ( fmt ) + 1 ) ;
sprintf ( datefmt , " [%s] %s " , date , fmt ) ;
fmt = datefmt ;
}
}
/* this lock is also protecting against multiple threads
/* this lock is also protecting against multiple threads