Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

l_log.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

void Log_Close (void)
FILELog_FileStruct (void)
void Log_Flush (void)
void Log_Open (char *filename)
void Log_Print (char *fmt,...)
void Log_Shutdown (void)
void Log_Write (char *fmt,...)
void Log_WriteTimeStamped (char *fmt,...)


Function Documentation

void Log_Close void   ) 
 

Definition at line 86 of file l_log.c.

References botimport, fclose(), logfile_s::filename, logfile_s::fp, logfile, printf(), PRT_ERROR, and PRT_MESSAGE.

00087 {
00088     if (!logfile.fp) return;
00089     if (fclose(logfile.fp))
00090     {
00091         botimport.Print(PRT_ERROR, "can't close log file %s\n", logfile.filename);
00092         return;
00093     } //end if
00094     logfile.fp = NULL;
00095     botimport.Print(PRT_MESSAGE, "Closed log %s\n", logfile.filename);
00096 } //end of the function Log_Close

Here is the call graph for this function:

FILE* Log_FileStruct void   ) 
 

Definition at line 201 of file l_log.c.

References logfile_s::fp, and logfile.

00202 {
00203     return logfile.fp;
00204 } //end of the function Log_FileStruct

void Log_Flush void   ) 
 

Definition at line 165 of file l_log.c.

References fflush(), logfile_s::fp, and logfile.

00166 {
00167     if (logfile.fp) fflush(logfile.fp);
00168 } //end of the function Log_Flush

Here is the call graph for this function:

void Log_Open char *  filename  ) 
 

Definition at line 58 of file l_log.c.

References botimport, logfile_s::filename, fopen(), logfile_s::fp, LibVarValue(), logfile, MAX_LOGFILENAMESIZE, printf(), PRT_ERROR, PRT_MESSAGE, strlen(), and strncpy().

Referenced by Export_BotLibSetup(), and main().

00059 {
00060     if (!LibVarValue("log", "0")) return;
00061     if (!filename || !strlen(filename))
00062     {
00063         botimport.Print(PRT_MESSAGE, "openlog <filename>\n");
00064         return;
00065     } //end if
00066     if (logfile.fp)
00067     {
00068         botimport.Print(PRT_ERROR, "log file %s is already opened\n", logfile.filename);
00069         return;
00070     } //end if
00071     logfile.fp = fopen(filename, "wb");
00072     if (!logfile.fp)
00073     {
00074         botimport.Print(PRT_ERROR, "can't open the log file %s\n", filename);
00075         return;
00076     } //end if
00077     strncpy(logfile.filename, filename, MAX_LOGFILENAMESIZE);
00078     botimport.Print(PRT_MESSAGE, "Opened log %s\n", logfile.filename);
00079 } //end of the function Log_Create

Here is the call graph for this function:

void Log_Print char *  fmt,
  ...
 

Definition at line 127 of file l_log.c.

References fflush(), logfile_s::fp, fprintf(), Log_UnifyEndOfLine(), logfile, printf(), va_end, va_list, va_start, and vsprintf().

Referenced by AAS_AllocMaxAAS(), AAS_CalcReachAndClusters(), AAS_CheckArea(), AAS_Create(), AAS_CreateAreaSettings(), AAS_CreateCurveBrushes(), AAS_FindBestAreaSplitPlane(), AAS_FixMapBrush(), AAS_FlipAreaFaces(), AAS_FreeMaxAAS(), AAS_HashVec(), AAS_MakeBrushWindings(), AAS_PruneNodes(), AAS_ShowNumReachabilities(), AAS_ShowTotals(), AAS_SplitArea(), AAS_StoreAreaSettings(), AAS_TestSplitPlane(), AAS_WriteAASFile(), AAS_WriteAASLump(), BrushBSP(), BuildTree(), CheckBSPBrush(), ChopBrushes(), Com_Printf(), CountTriangles(), CreateAASFilesForAllBSPFiles(), FillOutside(), FindBrushInTree(), FindPortalSide(), FloodAreas(), FloodAreas_r(), FloodEntities(), FloodPortals_r(), GetAreaPortalBrush(), HL_AllocMaxBSP(), HL_CreateBrushes_r(), HL_CreateBrushesFromBSP(), HL_FixContentsTextures(), HL_FreeMaxBSP(), HL_LoadMapFromBSP(), HL_SplitBrush(), HL_SplitBrushWithFace(), LoadCfgFile(), main(), MakeBrushWindings(), MakeTreePortals(), MakeTreePortals_r(), MarkVisibleSides(), MergeWindings(), PrintMapInfo(), PrintMemorySize(), Q1_AllocMaxBSP(), Q1_CreateBrushes_r(), Q1_CreateBrushesFromBSP(), Q1_FixContentsTextures(), Q1_FreeMaxBSP(), Q1_LoadMapFromBSP(), Q1_SplitBrush(), Q1_SplitBrushWithFace(), Q2_AllocMaxBSP(), Q2_BrushContents(), Q2_BSPBrushToMapBrush(), Q2_FreeMaxBSP(), Q2_LoadMapFile(), Q2_LoadMapFromBSP(), Q2_ParseBrush(), Q3_BrushContents(), Q3_BSPBrushToMapBrush(), Q3_CreatePlanarSurfacePlanes(), Q3_FindVisibleBrushSides(), Q3_LoadMapFromBSP(), Q3_PrintBSPFileSizes(), Q3_SurfacePlane(), RunThreadsOn(), ScriptError(), ScriptWarning(), SetAreaPortalAreas_r(), Sin_AllocMaxBSP(), Sin_BSPBrushToMapBrush(), Sin_FreeMaxBSP(), Sin_LoadMapFromBSP(), Sin_PrintBSPFileSizes(), SourceError(), SourceWarning(), TestExpandBrushes(), TH_AASToTetrahedrons(), TH_TetrahedralDecomposition(), ThreadSetupLock(), Tree_Free(), Tree_PruneNodes(), TryMergeBrushes(), and WriteMapFile().

00128 {
00129     va_list ap;
00130     char buf[2048];
00131 
00132     va_start(ap, fmt);
00133     vsprintf(buf, fmt, ap);
00134     va_end(ap);
00135 
00136     if (verbose)
00137     {
00138 #ifdef WINBSPC
00139         WinBSPCPrint(buf);
00140 #else
00141         printf("%s", buf);
00142 #endif //WINBSPS
00143     } //end if
00144 
00145     if (logfile.fp)
00146     {
00147         Log_UnifyEndOfLine(buf);
00148         fprintf(logfile.fp, "%s", buf);
00149         fflush(logfile.fp);
00150     } //end if
00151 } //end of the function Log_Print

Here is the call graph for this function:

void Log_Shutdown void   ) 
 

Definition at line 103 of file l_log.c.

References logfile_s::fp, Log_Close(), and logfile.

00104 {
00105     if (logfile.fp) Log_Close();
00106 } //end of the function Log_Shutdown

Here is the call graph for this function:

void Log_Write char *  fmt,
  ...
 

Definition at line 113 of file l_log.c.

References fflush(), logfile_s::fp, fprintf(), Log_UnifyEndOfLine(), logfile, QDECL, va_end, va_list, va_start, vfprintf(), and vsprintf().

Referenced by AAS_AlternativeRouteGoals(), AAS_BestReachableArea(), AAS_CheckArea(), AAS_CheckAreaForPossiblePortals(), AAS_CheckAreaSharedFaces(), AAS_CheckAreaWindingPlanes(), AAS_CheckFaceWindingPlane(), AAS_CountForcedClusterPortals(), AAS_CreateAreas(), AAS_CreateAreaSettings(), AAS_FindBestAreaSplitPlane(), AAS_FlipAreaFaces(), AAS_FlipSharedFaces(), AAS_GetFace(), AAS_GravitationalSubdivision(), AAS_InitClustering(), AAS_LadderSubdivision(), AAS_MeltAreaFaceWindings(), AAS_MergeAreaFaces(), AAS_MergeAreaPlaneFaces(), AAS_MergeAreas(), AAS_PruneNodes(), AAS_RandomGoalArea(), AAS_Reachability_Elevator(), AAS_Reachability_FuncBobbing(), AAS_Reachability_Grapple(), AAS_Reachability_Jump(), AAS_Reachability_Ladder(), AAS_Reachability_WeaponJump(), AAS_RemoveTinyFaces(), AAS_SplitFace(), AAS_StoreFile(), AAS_TestPortals(), AAS_TryMergeFaces(), AAS_UpdatePortal(), BotCheckChatMessageIntegrety(), BotDumpAvoidGoals(), BotDumpCharacter(), BotDumpGoalStack(), BotDumpInitialChat(), BotImport_Print(), BotInitLevelItems(), BotUpdateEntityItems(), BrushBSP(), ChopBrushes(), Com_DPrintf(), Error(), FindPlaneSeperatingWindings(), HL_TextureBrushes(), ItemWeightIndex(), MakeTreePortals(), MarkBrushBevels(), PC_DollarEvaluate(), PC_Evaluate(), PC_EvaluateTokens(), PC_ExpandDefine(), PC_PrintDefineHashTable(), PrintContents(), Q1_TextureBrushes(), Q3_BrushContents(), SplitBrush(), Warning(), and WriteMapBrush().

00114 {
00115     va_list ap;
00116 
00117     if (!logfile.fp) return;
00118     va_start(ap, fmt);
00119     vfprintf(logfile.fp, fmt, ap);
00120     va_end(ap);
00121     //fprintf(logfile.fp, "\r\n");
00122     fflush(logfile.fp);
00123 } //end of the function Log_Write

Here is the call graph for this function:

void Log_WriteTimeStamped char *  fmt,
  ...
 

Definition at line 130 of file l_log.c.

References botlibglobals, fflush(), logfile_s::fp, fprintf(), logfile, logfile_s::numwrites, QDECL, botlib_globals_s::time, va_end, va_list, va_start, and vfprintf().

00131 {
00132     va_list ap;
00133 
00134     if (!logfile.fp) return;
00135     fprintf(logfile.fp, "%d   %02d:%02d:%02d:%02d   ",
00136                     logfile.numwrites,
00137                     (int) (botlibglobals.time / 60 / 60),
00138                     (int) (botlibglobals.time / 60),
00139                     (int) (botlibglobals.time),
00140                     (int) ((int) (botlibglobals.time * 100)) -
00141                             ((int) botlibglobals.time) * 100);
00142     va_start(ap, fmt);
00143     vfprintf(logfile.fp, fmt, ap);
00144     va_end(ap);
00145     fprintf(logfile.fp, "\r\n");
00146     logfile.numwrites++;
00147     fflush(logfile.fp);
00148 } //end of the function Log_Write

Here is the call graph for this function:


Generated on Thu Aug 25 12:42:55 2005 for Quake III Arena by  doxygen 1.3.9.1