Skip to content

Commit

Permalink
Logging part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
TimePath authored and Kangz committed Feb 6, 2016
1 parent 68b167f commit 2bf1076
Show file tree
Hide file tree
Showing 82 changed files with 671 additions and 762 deletions.
4 changes: 2 additions & 2 deletions daemon/src/common/cm/cm_load.cpp
Expand Up @@ -659,7 +659,7 @@ static void CMod_CreateBrushSideWindings()
totalEdges += brush->numEdges;
}

cmLog.Debug( "Allocated %d bytes for %d collision map edges...\n", totalEdgesAlloc, totalEdges );
cmLog.Debug( "Allocated %d bytes for %d collision map edges...", totalEdgesAlloc, totalEdges );
}

/*
Expand Down Expand Up @@ -909,7 +909,7 @@ void CM_LoadMap(Str::StringRef name)
{
dheader_t header;

cmLog.Debug( "CM_LoadMap(%s)\n", name);
cmLog.Debug( "CM_LoadMap(%s)", name);

std::string mapFile = "maps/" + name + ".bsp";
std::string mapData;
Expand Down
2 changes: 1 addition & 1 deletion daemon/src/common/cm/cm_patch.cpp
Expand Up @@ -552,7 +552,7 @@ static void CM_SetBorderInward( cFacet_t *facet, cGrid_t *grid,
else
{
// bisecting side border
cmLog.Debug( "WARNING: CM_SetBorderInward: mixed plane sides\n" );
cmLog.Debug( "WARNING: CM_SetBorderInward: mixed plane sides" );
facet->borderInward[ k ] = false;

if ( !debugBlock )
Expand Down
2 changes: 1 addition & 1 deletion daemon/src/common/cm/cm_plane.cpp
Expand Up @@ -621,7 +621,7 @@ void CM_AddFacetBevels( cFacet_t *facet )

if ( !w2 )
{
cmLog.Debug( "WARNING: CM_AddFacetBevels... invalid bevel\n" );
cmLog.Debug( "WARNING: CM_AddFacetBevels... invalid bevel" );
continue;
}
else
Expand Down
4 changes: 2 additions & 2 deletions daemon/src/common/cm/cm_trisoup.cpp
Expand Up @@ -175,7 +175,7 @@ static void CM_SetBorderInward( cFacet_t *facet, cTriangleSoup_t *triSoup, int i
else
{
// bisecting side border
cmLog.Debug( "WARNING: CM_SetBorderInward: mixed plane sides\n" );
cmLog.Debug( "WARNING: CM_SetBorderInward: mixed plane sides" );
facet->borderInward[ k ] = false;
}
}
Expand Down Expand Up @@ -342,7 +342,7 @@ cSurfaceCollide_t *CM_GenerateTriangleSoupCollide( int numVertexes, vec3_t *vert
sc->bounds[ 1 ][ 1 ] += 1;
sc->bounds[ 1 ][ 2 ] += 1;

cmLog.Debug( "CM_GenerateTriangleSoupCollide: %i planes %i facets\n", sc->numPlanes, sc->numFacets );
cmLog.Debug( "CM_GenerateTriangleSoupCollide: %i planes %i facets", sc->numPlanes, sc->numFacets );

return sc;
}
8 changes: 4 additions & 4 deletions daemon/src/engine/botlib/bot_load.cpp
Expand Up @@ -163,7 +163,7 @@ bool BotLoadNavMesh( const char *filename, NavData_t &nav )
Cvar_VariableStringBuffer( "mapname", mapname, sizeof( mapname ) );
Cvar_VariableStringBuffer( "fs_game", gameName, sizeof( gameName ) );
Com_sprintf( filePath, sizeof( filePath ), "maps/%s-%s.navMesh", mapname, filename );
Com_Printf( " loading navigation mesh file '%s'...\n", filePath );
Log::Notice( " loading navigation mesh file '%s'...", filePath );

int len = FS_FOpenFileRead( filePath, &f, true );

Expand Down Expand Up @@ -388,7 +388,7 @@ bool BotSetupNav( const botClass_t *botClass, qhandle_t *navHandle )

if ( numNavData == MAX_NAV_DATA )
{
Com_Printf( "^3ERROR: maximum number of navigation meshes exceeded\n" );
Log::Warn( "maximum number of navigation meshes exceeded" );
return false;
}

Expand All @@ -406,14 +406,14 @@ bool BotSetupNav( const botClass_t *botClass, qhandle_t *navHandle )

if ( !nav->query )
{
Com_Printf( "Could not allocate Detour Navigation Mesh Query for navmesh %s\n", filename );
Log::Notice( "Could not allocate Detour Navigation Mesh Query for navmesh %s", filename );
BotShutdownNav();
return false;
}

if ( dtStatusFailed( nav->query->init( nav->mesh, maxNavNodes->integer ) ) )
{
Com_Printf( "Could not init Detour Navigation Mesh Query for navmesh %s\n", filename );
Log::Notice( "Could not init Detour Navigation Mesh Query for navmesh %s", filename );
BotShutdownNav();
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion daemon/src/engine/botlib/bot_nav.cpp
Expand Up @@ -116,7 +116,7 @@ void BotSetNavMesh( int botClientNum, qhandle_t nav )
{
if ( nav < 0 || nav >= numNavData )
{
Com_Printf( "^3ERROR: Navigation handle out of bounds\n" );
Log::Warn( "Navigation handle out of bounds" );
return;
}

Expand Down
32 changes: 16 additions & 16 deletions daemon/src/engine/botlib/bot_nav_edit.cpp
Expand Up @@ -171,17 +171,17 @@ void Cmd_NavEdit()
{
int argc = Cmd_Argc();
const char *arg = nullptr;
const char usage[] = "Usage: navedit enable/disable/save <navmesh>\n";
const char usage[] = "Usage: navedit enable/disable/save <navmesh>";

if ( !Cvar_VariableIntegerValue( "sv_cheats" ) )
{
Com_Printf( "navedit only available in local devmap\n" );
Log::Notice( "navedit only available in local devmap" );
return;
}

if ( argc < 2 )
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
return;
}

Expand All @@ -192,7 +192,7 @@ void Cmd_NavEdit()
int i;
if ( argc < 3 )
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
return;
}

Expand All @@ -208,7 +208,7 @@ void Cmd_NavEdit()

if ( i == numNavData )
{
Com_Printf( "\'%s\' is not a valid navmesh name\n", arg );
Log::Notice( "\'%s\' is not a valid navmesh name", arg );
return;
}

Expand All @@ -234,20 +234,20 @@ void Cmd_NavEdit()
}
else
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
}
}

void Cmd_AddConnection()
{
const char usage[] = "Usage: addcon start <dir> (radius)\n"
" addcon end\n";
" addcon end";
const char *arg = nullptr;
int argc = Cmd_Argc();

if ( argc < 2 )
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
return;
}

Expand All @@ -262,7 +262,7 @@ void Cmd_AddConnection()

if ( argc < 3 )
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
return;
}

Expand All @@ -278,7 +278,7 @@ void Cmd_AddConnection()
}
else
{
Com_Printf( "Invalid argument for direction, specify oneway or twoway\n" );
Log::Notice( "Invalid argument for direction, specify oneway or twoway" );
return;
}

Expand Down Expand Up @@ -337,7 +337,7 @@ void Cmd_AddConnection()
}
else
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
}
}

Expand All @@ -357,7 +357,7 @@ static void adjustConnectionSize( int dir )
if ( newConnectionSize != connectionSize )
{
connectionSize = newConnectionSize;
Com_Printf( "Default connection size = %d\n", connectionSize );
Log::Notice( "Default connection size = %d", connectionSize );
}
}

Expand All @@ -373,19 +373,19 @@ void Cmd_ConnectionSizeDown()

void Cmd_NavTest()
{
const char usage[] = "Usage: navtest shownodes/hidenodes/showportals/hideportals/startpath/endpath\n";
const char usage[] = "Usage: navtest shownodes/hidenodes/showportals/hideportals/startpath/endpath";
const char *arg = nullptr;
int argc = Cmd_Argc();

if ( !cmd.enabled )
{
Com_Printf( "%s", "Can't test navmesh without enabling navedit" );
Log::Notice( "%s", "Can't test navmesh without enabling navedit" );
return;
}

if ( argc < 2 )
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
return;
}

Expand Down Expand Up @@ -439,7 +439,7 @@ void Cmd_NavTest()
}
else
{
Com_Printf( "%s", usage );
Log::Notice( "%s", usage );
}
}

Expand Down
30 changes: 15 additions & 15 deletions daemon/src/engine/client/cin_ogm.cpp
Expand Up @@ -349,7 +349,7 @@ static int loadVideoFrameTheora()

if ( yWShift < 0 || uvWShift < 0 || yHShift < 0 || uvHShift < 0 )
{
Com_Printf( "[Theora] unexpected resolution in a YUV frame\n" );
Log::Notice( "[Theora] unexpected resolution in a YUV frame\n" );
r = -1;
}
else
Expand Down Expand Up @@ -522,7 +522,7 @@ int Cin_OGM_Init( const char *filename )

if ( g_ogm.ogmFile )
{
Com_Printf( S_WARNING "there is already an OGM running, which will be stopped before starting %s\n", filename );
Log::Warn( "there is already an OGM running, which will be stopped before starting %s", filename );
Cin_OGM_Shutdown();
}

Expand All @@ -532,7 +532,7 @@ int Cin_OGM_Init( const char *filename )

if ( !g_ogm.ogmFile )
{
Com_Printf( S_WARNING "Can't open OGM file for reading (%s)\n", filename );
Log::Warn( "Can't open OGM file for reading (%s)", filename );
return -1;
}

Expand All @@ -549,7 +549,7 @@ int Cin_OGM_Init( const char *filename )
//FIXME? better way to find audio stream
if ( g_ogm.os_audio.serialno )
{
Com_Printf( S_WARNING "more than one audio stream in OGM file(%s). We will stay at the first one\n", filename );
Log::Warn( "more than one audio stream in OGM file(%s). We will stay at the first one", filename );
}
else
{
Expand All @@ -562,7 +562,7 @@ int Cin_OGM_Init( const char *filename )
{
if ( g_ogm.os_video.serialno )
{
Com_Printf( S_WARNING "more than one video stream in OGM file(%s). We will stay at the first one\n", filename );
Log::Warn( "more than one video stream in OGM file(%s). We will stay at the first one", filename );
}
else
{
Expand All @@ -581,13 +581,13 @@ int Cin_OGM_Init( const char *filename )

if ( !g_ogm.os_audio.serialno )
{
Com_Printf( S_WARNING "Didn't find a Vorbis audio stream in %s\n", filename );
Log::Warn( "Didn't find a Vorbis audio stream in %s", filename );
return -2;
}

if ( !g_ogm.os_video.serialno )
{
Com_Printf( S_WARNING "Haven't found a video stream in OGM file (%s)\n", filename );
Log::Warn( "Haven't found a video stream in OGM file (%s)", filename );
return -3;
}

Expand All @@ -602,7 +602,7 @@ int Cin_OGM_Init( const char *filename )

if ( status < 0 )
{
Com_Printf( S_WARNING "Corrupt Ogg packet while loading Vorbis headers (%s)\n", filename );
Log::Warn( "Corrupt Ogg packet while loading Vorbis headers (%s)", filename );
return -8;
}

Expand All @@ -612,7 +612,7 @@ int Cin_OGM_Init( const char *filename )

if ( i == 0 && status < 0 )
{
Com_Printf( S_WARNING "This Ogg bitstream does not contain Vorbis audio data (%s)\n", filename );
Log::Warn( "This Ogg bitstream does not contain Vorbis audio data (%s)", filename );
return -9;
}

Expand All @@ -622,7 +622,7 @@ int Cin_OGM_Init( const char *filename )
{
if ( loadBlockToSync() )
{
Com_Printf( S_WARNING "Couldn't find all Vorbis headers before end of OGM file (%s)\n", filename );
Log::Warn( "Couldn't find all Vorbis headers before end of OGM file (%s)", filename );
return -10;
}
}
Expand All @@ -645,7 +645,7 @@ int Cin_OGM_Init( const char *filename )

if ( status < 0 )
{
Com_Printf( S_WARNING "Corrupt Ogg packet while loading Theora headers (%s)\n", filename );
Log::Warn( "Corrupt Ogg packet while loading Theora headers (%s)", filename );
return -8;
}

Expand All @@ -655,7 +655,7 @@ int Cin_OGM_Init( const char *filename )

if ( i == 0 && status != 0 )
{
Com_Printf( S_WARNING "This Ogg bitstream does not contain Theora data (%s)\n", filename );
Log::Warn( "This Ogg bitstream does not contain Theora data (%s)", filename );
return -9;
}

Expand All @@ -665,7 +665,7 @@ int Cin_OGM_Init( const char *filename )
{
if ( loadBlockToSync() )
{
Com_Printf( S_WARNING "Couldn't find all Theora headers before end of OGM file (%s)\n", filename );
Log::Warn( "Couldn't find all Theora headers before end of OGM file (%s)", filename );
return -10;
}
}
Expand All @@ -675,13 +675,13 @@ int Cin_OGM_Init( const char *filename )

if ( !isPowerOf2( g_ogm.th_info.width ) )
{
Com_Printf( S_WARNING "Video width of the OGM file isn't a power of 2 (%s)\n", filename );
Log::Warn( "Video width of the OGM file isn't a power of 2 (%s)", filename );
return -5;
}

if ( !isPowerOf2( g_ogm.th_info.height ) )
{
Com_Printf( S_WARNING "Video height of the OGM file isn't a power of 2 (%s)\n", filename );
Log::Warn( "Video height of the OGM file isn't a power of 2 (%s)", filename );
return -6;
}

Expand Down
6 changes: 3 additions & 3 deletions daemon/src/engine/client/cl_avi.cpp
Expand Up @@ -394,7 +394,7 @@ bool CL_OpenAVIForWriting( const char *fileName )
suggestRate--;
}

Com_Printf( S_WARNING "cl_aviFrameRate is not a divisor of the audio rate, suggest %d\n", suggestRate );
Log::Warn( "cl_aviFrameRate is not a divisor of the audio rate, suggest %d", suggestRate );
}

if ( !Cvar_VariableIntegerValue( "s_initsound" ) )
Expand All @@ -415,7 +415,7 @@ bool CL_OpenAVIForWriting( const char *fileName )
else
{
afd.audio = false;
Com_Printf( S_WARNING "Audio capture is not supported with OpenAL. Set s_useOpenAL to 0 for audio capture\n" );
Log::Warn( "Audio capture is not supported with OpenAL. Set s_useOpenAL to 0 for audio capture" );
}

// This doesn't write a real header, but allocates the
Expand Down Expand Up @@ -603,7 +603,7 @@ bool CL_CloseAVI()
Z_Free( afd.eBuffer );
FS_FCloseFile( afd.f );

Com_Printf( "Wrote %d:%d frames to %s\n", afd.numVideoFrames, afd.numAudioFrames, afd.fileName );
Log::Notice( "Wrote %d:%d frames to %s\n", afd.numVideoFrames, afd.numAudioFrames, afd.fileName );

return true;
}
Expand Down

0 comments on commit 2bf1076

Please sign in to comment.