Class to manage logging to memory or file. More...
#include <mi32/milog.h>
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 FILEPATH & | GetOwnFilePath () const |
| const MISTRING & | GetString () const |
| bool | IsActive () const |
| void | SetLabel (const char *label) |
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.
| enum MILOG::MODE |
Logging modes.
| MILOG::MILOG | ( | ) |
Constructor.
| MILOG::~MILOG | ( | ) |
Destructor.
| void MILOG::AddText | ( | const MISTRING & | text | ) |
Add text to log (thread-safe).
| void MILOG::AddText | ( | const char * | text | ) |
Add text to log (thread-safe).
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.
| 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.
| label | Label to include, NULL for none |
1.6.1