Ignore:
Timestamp:
Apr 25, 2008, 2:57:33 AM (14 years ago)
Author:
charles
Message:

fold most of the "deep logging" functions into a single function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r5455 r5689  
    4141#endif
    4242#include <unistd.h>
    43 #include <libgen.h> /* basename, dirname */
     43#include <libgen.h> /* dirname */
    4444#include <fcntl.h> /* O_LARGEFILE */
    4545
     
    6060#endif
    6161
    62 /**
    63 ***
    64 **/
    65 
    66 static void
    67 myDebug( const char * file, int line, const char * fmt, ... )
    68 {
    69     FILE * fp = tr_getLog( );
    70     if( fp != NULL )
    71     {
    72         va_list args;
    73         char s[64];
    74         struct evbuffer * buf = evbuffer_new( );
    75         char * myfile = tr_strdup( file );
    76 
    77         evbuffer_add_printf( buf, "[%s] ", tr_getLogTimeStr( s, sizeof(s) ) );
    78         va_start( args, fmt );
    79         evbuffer_add_vprintf( buf, fmt, args );
    80         va_end( args );
    81         evbuffer_add_printf( buf, " (%s:%d)\n", basename(myfile), line );
    82         fwrite( EVBUFFER_DATA(buf), 1, EVBUFFER_LENGTH(buf), fp );
    83 
    84         tr_free( myfile );
    85         evbuffer_free( buf );
    86     }
    87 }
    88 
    89 #define dbgmsg(fmt...) myDebug(__FILE__, __LINE__, ##fmt )
     62#define dbgmsg(fmt...) tr_deepLog( __FILE__, __LINE__, NULL, ##fmt )
    9063
    9164/**
Note: See TracChangeset for help on using the changeset viewer.