Cosmetics in debug in ssl_{client,server}2.c
Print only the basename from the file, and print level too.
This commit is contained in:
parent
acecb653d5
commit
052f28853b
@ -315,9 +315,14 @@ static void my_debug( void *ctx, int level,
|
|||||||
const char *file, int line,
|
const char *file, int line,
|
||||||
const char *str )
|
const char *str )
|
||||||
{
|
{
|
||||||
((void) level);
|
const char *p, *basename;
|
||||||
|
|
||||||
mbedtls_fprintf( (FILE *) ctx, "%s:%04d: %s", file, line, str );
|
/* Extract basename from file */
|
||||||
|
for( p = basename = file; *p != '\0'; p++ )
|
||||||
|
if( *p == '/' || *p == '\\' )
|
||||||
|
basename = p + 1;
|
||||||
|
|
||||||
|
mbedtls_fprintf( (FILE *) ctx, "%s:%04d: |%d| %s", basename, line, level, str );
|
||||||
fflush( (FILE *) ctx );
|
fflush( (FILE *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,9 +394,14 @@ static void my_debug( void *ctx, int level,
|
|||||||
const char *file, int line,
|
const char *file, int line,
|
||||||
const char *str )
|
const char *str )
|
||||||
{
|
{
|
||||||
((void) level);
|
const char *p, *basename;
|
||||||
|
|
||||||
mbedtls_fprintf( (FILE *) ctx, "%s:%04d: %s", file, line, str );
|
/* Extract basename from file */
|
||||||
|
for( p = basename = file; *p != '\0'; p++ )
|
||||||
|
if( *p == '/' || *p == '\\' )
|
||||||
|
basename = p + 1;
|
||||||
|
|
||||||
|
mbedtls_fprintf( (FILE *) ctx, "%s:%04d: |%d| %s", basename, line, level, str );
|
||||||
fflush( (FILE *) ctx );
|
fflush( (FILE *) ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user