include line num in log

This commit is contained in:
Eric House 2021-12-24 08:24:41 -08:00
parent 2fcf4db58f
commit a9e44fe132
2 changed files with 5 additions and 5 deletions

View file

@ -65,9 +65,9 @@ linux_debugf( const char* format, ... )
}
void
linux_debugff( const char* func, const char* file, const char* fmt, ...)
linux_debugff( const char* func, const char* file, int line, const char* fmt, ...)
{
gchar* header = g_strdup_printf( "%s:%s(): %s", file, func, fmt );
gchar* header = g_strdup_printf( "%s:%d:%s(): %s", file, line, func, fmt );
va_list ap;
va_start( ap, fmt );

View file

@ -77,10 +77,10 @@ extern void linux_debugf(const char*, ...)
__attribute__ ((format (printf, 1, 2)));
# define XP_DEBUGF(...) linux_debugf(__VA_ARGS__)
extern void linux_debugff(const char* func, const char* file, const char* fmt, ...)
__attribute__ ((format (printf, 3, 4)));
extern void linux_debugff(const char* func, const char* file, int line, const char* fmt, ...)
__attribute__ ((format (printf, 4, 5)));
# define XP_LOGFF( FMT, ... ) \
linux_debugff( __func__, __FILE__, FMT, ##__VA_ARGS__ )
linux_debugff( __func__, __FILE__, __LINE__, FMT, ##__VA_ARGS__ )
#define XP_LOG(STR) \
linux_debugff( __func__, __FILE__, "%s", STR )