Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

pglog.h File Reference


Detailed Description

ParaGUI logging facility.

This header declares the PG_LogConsole namespace and all functions for log processing.


Namespaces

namespace  PG_LogConsole

Defines

#define PG_LOGMTH_STDOUT   1
 Logmethod: STDOUT.
#define PG_LOGMTH_STDERR   2
 Logmethod: STDERR.
#define PG_LOGMTH_CONSOLE   4
 Logmethod: CONSOLE.

Enumerations

enum  PG_LOG_LEVEL {
  PG_LOG_NONE, PG_LOG_ERR, PG_LOG_WRN, PG_LOG_MSG,
  PG_LOG_DBG
}
 ParaGUI logging level. More...

Functions

void LogVA (PG_LOG_LEVEL id, const char *Text, va_list ap)
 Log a message.
void Done ()
 Clears the list of log messages and removes the log window.
void Update ()
 Updates the log window.
void SetLogLevel (PG_LOG_LEVEL newlevel)
 Set the minimum log level.
void Show ()
 Show the log window.
void Hide ()
 Hide the log window.
void Toggle ()
 Toggle between log window shown/hidden.
void SetMethod (int method)
 Set the log method.
int GetMethod ()
 Get the log method.
void SetConsoleKey (SDLKey key)
 Set the key to toggle the console (default F12).
SDLKey GetConsoleKey ()
 Get the current key to toggle console.
void SetTitle (const char *title, PG_Label::TextAlign alignment=PG_Label::CENTER)
 Set the title of the log console window.
void SetMaxLogLines (Uint32 max)
 Set a limit for the amount of log lines (200 lines by default).
void PG_Log (PG_LOG_LEVEL id, const char *Text,...)
 Log a message.
void PG_LogMSG (const char *fmt,...)
 Log a message with log level "message".
void PG_LogERR (const char *fmt,...)
 Log a message with log level "error".
void PG_LogWRN (const char *fmt,...)
 Log a message with log level "warning".
void PG_LogDBG (const char *fmt,...)
 Log a message with log level "debug".


Define Documentation

#define PG_LOGMTH_CONSOLE   4
 

Logmethod: CONSOLE.

Send all log messages to the console window.

#define PG_LOGMTH_STDERR   2
 

Logmethod: STDERR.

Send all log messages to stderr.

#define PG_LOGMTH_STDOUT   1
 

Logmethod: STDOUT.

Send all log messages to stdout.


Enumeration Type Documentation

enum PG_LOG_LEVEL
 

ParaGUI logging level.

Enumeration values:
PG_LOG_NONE  log nothing
PG_LOG_ERR  only errors
PG_LOG_WRN  errors and warnings
PG_LOG_MSG  display errors, warnings and messages
PG_LOG_DBG  log everything


Function Documentation

void PG_LogConsole::Done  ) 
 

Clears the list of log messages and removes the log window.

SDLKey PG_LogConsole::GetConsoleKey  ) 
 

Get the current key to toggle console.

Returns:
current key to toggle the console

int PG_LogConsole::GetMethod  ) 
 

Get the log method.

Returns:
current log method

void PG_LogConsole::Hide  ) 
 

Hide the log window.

void PG_LogConsole::LogVA PG_LOG_LEVEL  id,
const char *  Text,
va_list  ap
 

Log a message.

Don't use this function directly, it is unconvenient and meant for internal use only. Use The PG_Log functions instead if you want to log something.

Parameters:
id the log level of the message
Text the message text *printf format string)
ap the variable list

void PG_Log PG_LOG_LEVEL  id,
const char *  Text,
  ...
 

Log a message.

Parameters:
id the log level id of the message
Text a printf format string, arbitrary arguments may follow

void PG_LogDBG const char *  fmt,
  ...
 

Log a message with log level "debug".

Parameters:
fmt printf format string

void PG_LogERR const char *  fmt,
  ...
 

Log a message with log level "error".

Parameters:
fmt printf format string

void PG_LogMSG const char *  fmt,
  ...
 

Log a message with log level "message".

Parameters:
fmt printf format log string

void PG_LogWRN const char *  fmt,
  ...
 

Log a message with log level "warning".

Parameters:
fmt printf format string

void PG_LogConsole::SetConsoleKey SDLKey  key  ) 
 

Set the key to toggle the console (default F12).

Parameters:
key the key to toggle the console The key will be used by PG_Application to toggle the log console.

void PG_LogConsole::SetLogLevel PG_LOG_LEVEL  newlevel  ) 
 

Set the minimum log level.

Parameters:
newlevel the new minimum log level All log messages with a log level smaller than newlevel will be quietly discarded.

void PG_LogConsole::SetMaxLogLines Uint32  max  ) 
 

Set a limit for the amount of log lines (200 lines by default).

Parameters:
max maximum amount of log lines.

void PG_LogConsole::SetMethod int  method  ) 
 

Set the log method.

Parameters:
method determines where to log messages to

void PG_LogConsole::SetTitle const char *  title,
PG_Label::TextAlign  alignment = PG_Label::CENTER
 

Set the title of the log console window.

Parameters:
title the title of the window
alignment the alingment of the title

void PG_LogConsole::Show  ) 
 

Show the log window.

void PG_LogConsole::Toggle  ) 
 

Toggle between log window shown/hidden.

void PG_LogConsole::Update  ) 
 

Updates the log window.

This function creates a log window if it doesn't exist and writes all log messages to this window.


Generated on Tue Jun 24 02:25:20 2008 for ParaGUI by  doxygen 1.4.2