mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) #1828: timestamp for log/debug output
This commit is contained in:
parent
dfa9f075a4
commit
fce040eb84
1 changed files with 8 additions and 3 deletions
|
@ -332,12 +332,17 @@ tr_msg( const char * file,
|
|||
}
|
||||
else
|
||||
{
|
||||
char timestr[64];
|
||||
|
||||
if( fp == NULL )
|
||||
fp = stderr;
|
||||
|
||||
tr_getLogTimeStr( timestr, sizeof( timestr ) );
|
||||
|
||||
if( name )
|
||||
fprintf( fp, "%s: %s\n", name, buf );
|
||||
fprintf( fp, "[%s] %s: %s\n", timestr, name, buf );
|
||||
else
|
||||
fprintf( fp, "%s\n", buf );
|
||||
fprintf( fp, "[%s] %s\n", timestr, buf );
|
||||
fflush( fp );
|
||||
}
|
||||
}
|
||||
|
@ -1403,7 +1408,7 @@ parseNumberSection( const char * str, int len, struct number_range * setme )
|
|||
char * tmp = tr_strndup( str, len );
|
||||
|
||||
errno = 0;
|
||||
a = strtol( tmp, &end, 10 );
|
||||
a = b = strtol( tmp, &end, 10 );
|
||||
if( errno || ( end == tmp ) ) {
|
||||
success = FALSE;
|
||||
} else if( *end != '-' ) {
|
||||
|
|
Loading…
Reference in a new issue