17 #include <pia/common/common_RootObject.h> 18 #include <pia/common/common_Time.h> 54 static bool IsFlagSetStatic(u64 flag)
57 NN_PIA_DUMMY_PARAM_IN_RELEASE(flag);
80 explicit Log(u32 mask);
113 NN_PIA_DUMMY_PARAM_IN_RELEASE(flag);
116 return (m_mask & flag) == flag;
127 void Write(u32 mask,
const char* pStr, ...);
137 void WriteCaption(u32 mask);
148 m_IsPrintTime = isPrint;
158 return m_IsPrintTime;
207 Log& operator=(
const Log&);
229 #if NN_PIA_UNDER_DEVELOP 230 #define PIA_LOG(mask, ...) \ 233 nn::pia::common::Log* pPiaLog = nn::pia::common::Log::GetGlobalObject(); \ 236 pPiaLog->WriteCaption(mask); \ 237 pPiaLog->Write(mask, __VA_ARGS__); \ 238 pPiaLog->Write(mask, "\n"); \ 243 #define PIA_LOG(mask, ...) {} 254 #if NN_PIA_UNDER_DEVELOP 255 #define PIA_LOG_EX(mask, ...) \ 257 nn::pia::common::Log* pPiaLog = nn::pia::common::Log::GetGlobalObject(); \ 260 pPiaLog->WriteCaption(mask); \ 261 pPiaLog->Write(mask, "%s %s:", PIA_CODE_POSITION_FILE, PIA_CODE_POSITION_FUNC); \ 262 pPiaLog->Write(mask, __VA_ARGS__); \ 263 pPiaLog->Write(mask, "\n"); \ 267 #define PIA_LOG_EX(mask, ...) {} 275 #if NN_PIA_UNDER_DEVELOP 276 #define PIA_RETURN_RESULT_WITH_LOG(result, ...) \ 278 nn::pia::common::Log* pPiaLog = nn::pia::common::Log::GetGlobalObject(); \ 281 u32 logLevelError_ = nn::pia::common::Log::LEVEL_ERROR; \ 282 pPiaLog->WriteCaption(logLevelError_); \ 283 pPiaLog->Write(logLevelError_, "[%s] %s %s:", #result, PIA_CODE_POSITION_FILE, PIA_CODE_POSITION_FUNC); \ 284 pPiaLog->Write(logLevelError_, __VA_ARGS__); \ 285 pPiaLog->Write(logLevelError_, "\n"); \ 287 PIA_RETURN_RESULT(result); \ 290 #define PIA_RETURN_RESULT_WITH_LOG(result, ...) { return result(); } static const u32 LEVEL_INFO
Specifies the detailed information level used inside Pia.
Definition: common_Log.h:44
static const u32 LEVEL_ALWAYS
Specifies the log level that is constantly displayed.
Definition: common_Log.h:48
This class is used for logging.
Definition: common_Log.h:39
Class that represents time.
Definition: common_Time.h:39
bool IsPrintTime() const
Gets whether time display is enabled or disabled.
Definition: common_Log.h:156
Log(void)
The constructor. Objects are constructed with all bits of the log level bit mask set to 1...
static const u32 LEVEL_WARNING
Specifies the warning level. (This should be changed, but can be ignored.)
Definition: common_Log.h:45
static void SetGlobalObject(Log *pLog)
Registers a global log object.
Definition: common_Log.h:179
static const u32 LEVEL_DEBUG
Specifies the debug information level used inside Pia.
Definition: common_Log.h:43
static const u32 LEVEL_FATAL
Specifies the error level (irrecoverable).
Definition: common_Log.h:47
void SetNow()
Makes this object represent the current time.
void SetMask(u32 mask)
Sets the mask. This allows you to suppress log messages of a particular level.
Definition: common_Log.h:96
void ResetBaseTime()
Resets the base time for the time display to the current time.
Definition: common_Log.h:165
void SetPrintTime(bool isPrint)
Enables and disables the time display.
Definition: common_Log.h:146
bool IsFlagSet(u64 flag) const
Indicates whether the specified flags are set.
Definition: common_Log.h:110
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40
static Log * GetGlobalObject(void)
Gets a pointer to the Log object set using SetGlobalObject().
Definition: common_Log.h:192
static const u32 LEVEL_ERROR
Specifies the error level (recoverable).
Definition: common_Log.h:46