CTR Pia
4.11.3
Game Communication Engine
|
This class is used for logging. More...
Public Member Functions | |
Log (void) | |
The constructor. Objects are constructed with all bits of the log level bit mask set to 1. | |
Log (u32 mask) | |
The constructor. A mask representing the log level can be specified as a parameter. More... | |
~Log () | |
The destructor. | |
bool | IsFlagSet (u64 flag) const |
Indicates whether the specified flags are set. More... | |
bool | IsPrintTime () const |
Gets whether time display is enabled or disabled. More... | |
void | ResetBaseTime () |
Resets the base time for the time display to the current time. | |
void | SetMask (u32 mask) |
Sets the mask. This allows you to suppress log messages of a particular level. More... | |
void | SetPrintTime (bool isPrint) |
Enables and disables the time display. More... | |
Static Public Member Functions | |
static Log * | GetGlobalObject (void) |
Gets a pointer to the Log object set using SetGlobalObject() . More... | |
static void | SetGlobalObject (Log *pLog) |
Registers a global log object. More... | |
Static Public Attributes | |
static const u32 | LEVEL_ALWAYS = 0x00000001 << 5 |
Specifies the log level that is constantly displayed. | |
static const u32 | LEVEL_DEBUG = 0x00000001 << 0 |
Specifies the debug information level used inside Pia. | |
static const u32 | LEVEL_ERROR = 0x00000001 << 3 |
Specifies the error level (recoverable). | |
static const u32 | LEVEL_FATAL = 0x00000001 << 4 |
Specifies the error level (irrecoverable). | |
static const u32 | LEVEL_INFO = 0x00000001 << 1 |
Specifies the detailed information level used inside Pia. | |
static const u32 | LEVEL_WARNING = 0x00000001 << 2 |
Specifies the warning level. (This should be changed, but can be ignored.) | |
This class is used for logging.
You can set a level for the log and switch between showing and hiding the log for each level.
2015-06-19 Added the PIA_LOG_EX()
macro.
2012-05-30 Times can now also be printed.
2012-05-30 Made the Write()
function private.
2012-04-19 Initial version.
|
explicit |
The constructor. A mask representing the log level can be specified as a parameter.
[in] | mask | Specifies a bit mask representing the log level. |
|
inlinestatic |
Gets a pointer to the Log
object set using SetGlobalObject()
.
Calling nn::pia::common::Initialize()
implicitly creates a Log
instance internally and sets this instance as the global log object.
|
inline |
Indicates whether the specified flags are set.
The result of IsFlagSet(TRACE_FLAG_NEVER)
is true
.
true
if the particular flag is set, or false
otherwise.[in] | flag | Specifies the trace flags to query. |
|
inline |
Gets whether time display is enabled or disabled.
true
if times are printed.
|
inlinestatic |
|
inline |
Sets the mask. This allows you to suppress log messages of a particular level.
This member function allows you to filter log information being output. Note that a log for which LEVEL_ALWAYS
has been specified is always output regardless of the mask set by this member function.
[in] | mask | Specifies a bit mask representing the log level. |
|
inline |
Enables and disables the time display.
When enabled, it displays the time passed from the base time in units of milliseconds, such as "[Pia:12345]..."
[in] | isPrint | Specify true to display the time. |