MILOG Class Reference

Class to manage logging to memory or file. More...

#include <mi32/milog.h>

List of all members.

Public Types

enum  MODE {
  MODE_NoLog = 0x0000, MODE_Memory = 0x0001, MODE_OwnFile = 0x0002, MODE_SharedFile = 0x0003,
  MODE_OnlyInternal = 0x0010, MODE_OnlyProgrammer = 0x0020, MODE_OnlyDebug = 0x0040, MODE_OnlyDV = 0x0080,
  MODE_NoChkUserEnabled = 0x0100, MODE_MASK_Location = 0x000F
}

Public Member Functions

 MILOG ()
 ~MILOG ()
void AddText (const MISTRING &text)
void AddText (const char *text)
ERRVALUE Create (MODE mode, INT32 MaxLogsMemory=0)
const FILEPATHGetOwnFilePath () const
const MISTRINGGetString () const
bool IsActive () const
void SetLabel (const char *label)

Detailed Description

Class to manage logging to memory or file.

Provides control over whether logging is done based on license or debug. This class is thread-safe in that text may be added to the log from threads. However, the log may not be created or retrieved from while there is a possibility that it may be updated from a thread.


Member Enumeration Documentation

Logging modes.

Enumerator:
MODE_NoLog 

Don't do any logging.

MODE_Memory 

Log to memory string (specific to log instance).

MODE_OwnFile 

Log to own (process instance) file.

MODE_SharedFile 

Log to shared (session) file.

MODE_OnlyInternal 

Only log for MicroImages "internal" license.

MODE_OnlyProgrammer 

Only log for "programmer" key.

MODE_OnlyDebug 

Only log in debug build.

MODE_OnlyDV 

Only log in "development" version.

MODE_NoChkUserEnabled 

Don't check if user has enabled "extended logging" - use with caution.

MODE_MASK_Location 

Constructor & Destructor Documentation

MILOG::MILOG (  ) 

Constructor.

MILOG::~MILOG (  ) 

Destructor.


Member Function Documentation

void MILOG::AddText ( const MISTRING text  ) 

Add text to log (thread-safe).

void MILOG::AddText ( const char *  text  ) 

Add text to log (thread-safe).

ERRVALUE MILOG::Create ( MODE  mode,
INT32  MaxLogsMemory = 0 
)

Create log, will clear if in memory.

If MODE_OwnFile is specified, a new file will be created based on the current timestamp and process name. By default, logging is only done if the user turns on "extended logging". Logging may be further limited based on the MODE setting. Logging on should be used only when necessary to avoid degrading performance.

Parameters:
MaxLogsMemory Maximum number of logs (if MODE_OwnFile) or memory size (if MODE_Memory)
const FILEPATH& MILOG::GetOwnFilePath (  )  const

Get path to log file if was created with MODE_OwnFile.

The process-instance file name is based on the application "name" and the time of the first call to Create() with MODE_OwnFile specified. Thus, the same file is shared for all logging within a specific process instance.

const MISTRING& MILOG::GetString (  )  const

Get log string if in memory.

If logging is to memory, each MILOG instance will have its own string.

bool MILOG::IsActive (  )  const [inline]

Determine if logging is active.

void MILOG::SetLabel ( const char *  label  ) 

Set label to include in log.

Label will appear after timestamp in log. Log must have been created first.

Parameters:
label Label to include, NULL for none

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:38 2012 for TNTsdk 2012 by  doxygen 1.6.1