Skip to content

Commit

Permalink
Refactor|Console|API: Printing log messages, removed old Console API …
Browse files Browse the repository at this point in the history
…functions

The engine should not internally use Con_Message, Con_Printf, or
Con_FPrintf to print log messages, as these do not provide the means
to indicate appropriate metadata for the entry.

Con_Printf and Con_FPrintf were removed altogether. All use of them
was replaced with LogBuffer_Printf.

Todo: Apply metadata to internal entries and in the plugins.
  • Loading branch information
skyjake committed Jan 12, 2014
1 parent f55bc15 commit 6848105
Show file tree
Hide file tree
Showing 30 changed files with 469 additions and 1,664 deletions.
10 changes: 0 additions & 10 deletions doomsday/api/api_console.h
Expand Up @@ -58,14 +58,9 @@ DENG_API_TYPEDEF(Con)
void (*SetUri)(char const* name, Uri const* uri);

void (*Message)(char const* message, ...);

void (*Printf)(char const* format, ...);
void (*FPrintf)(int flags, char const* format, ...);
void (*PrintRuler)(void);
void (*Error)(char const* error, ...);

void (*SetPrintFilter)(con_textfilter_t filter);

int (*Execute)(int silent, char const* command);
int (*Executef)(int silent, char const* command, ...);
}
Expand Down Expand Up @@ -99,14 +94,9 @@ DENG_API_T(Con);
#define Con_SetUri _api_Con.SetUri

#define Con_Message _api_Con.Message

#define Con_Printf _api_Con.Printf
#define Con_FPrintf _api_Con.FPrintf
#define Con_PrintRuler _api_Con.PrintRuler
#define Con_Error _api_Con.Error

#define Con_SetPrintFilter _api_Con.SetPrintFilter

#define DD_Execute _api_Con.Execute
#define DD_Executef _api_Con.Executef
#endif
Expand Down
3 changes: 2 additions & 1 deletion doomsday/api/apis.h
Expand Up @@ -72,7 +72,8 @@ enum {
DE_API_CLIENT = DE_API_CLIENT_v1,

DE_API_CONSOLE_v1 = 400, // 1.10
DE_API_CONSOLE = DE_API_CONSOLE_v1,
DE_API_CONSOLE_v2 = 401, // 1.14
DE_API_CONSOLE = DE_API_CONSOLE_v2,

DE_API_DEFINITIONS_v1 = 500, // 1.10
DE_API_DEFINITIONS = DE_API_DEFINITIONS_v1,
Expand Down
9 changes: 0 additions & 9 deletions doomsday/client/include/con_main.h
Expand Up @@ -314,15 +314,6 @@ AutoStr *Con_KnownWordToString(knownword_t const *word);
*/
void Con_Message(char const *message, ...) PRINTF_F(1,2);

/**
* Print a text fragment (manual/no line breaks) to the console.
*
* @param flags @ref consolePrintFlags
* @param format Format for the output using printf() formatting syntax.
*/
void Con_FPrintf(int flags, char const *format, ...) PRINTF_F(2,3);
void Con_Printf(char const *format, ...) PRINTF_F(1,2);

/// Print a ruler into the console.
void Con_PrintRuler();

Expand Down
3 changes: 2 additions & 1 deletion doomsday/client/src/client/cl_main.cpp
Expand Up @@ -347,7 +347,8 @@ void Cl_GetPackets()
char *text = (char *) M_Malloc(textLen + 1);
Reader_Read(msgReader, text, textLen);
text[textLen] = 0;
Con_FPrintf(conFlags, "%s", text);
DENG_UNUSED(conFlags);
LOG_NOTE("%s") << text;
M_Free(text);
break; }

Expand Down

0 comments on commit 6848105

Please sign in to comment.