Ignore:
Timestamp:
Oct 22, 2007, 6:52:36 PM (15 years ago)
Author:
charles
Message:

tweak the logging a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r3492 r3500  
    1616#include <stdio.h> /* printf */
    1717#include <limits.h> /* INT_MAX */
     18#include <libgen.h> /* basename */
    1819
    1920#include <sys/types.h> /* event.h needs this */
     
    139140    {
    140141        va_list args;
     142        char timestr[64];
    141143        struct evbuffer * buf = evbuffer_new( );
    142         char timestr[64];
     144        char * myfile = tr_strdup( file );
     145
    143146        evbuffer_add_printf( buf, "[%s] ", tr_getLogTimeStr( timestr, sizeof(timestr) ) );
    144147        if( t != NULL )
     
    147150        evbuffer_add_vprintf( buf, fmt, args );
    148151        va_end( args );
    149         evbuffer_add_printf( buf, " (%s:%d)\n", file, line );
    150 
     152        evbuffer_add_printf( buf, " (%s:%d)\n", basename(myfile), line );
    151153        fwrite( EVBUFFER_DATA(buf), 1, EVBUFFER_LENGTH(buf), fp );
     154
     155        tr_free( myfile );
    152156        evbuffer_free( buf );
    153157    }
Note: See TracChangeset for help on using the changeset viewer.