ctr_Repair/trunk/ConsoleDataMigration/common/CommonLogger.h
N2614 5ed32bde66 本体データ移行ツールを追加
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@2 385bec56-5757-e545-9c3a-d8741f4650f1
2011-01-28 10:46:13 +00:00

76 lines
2.2 KiB
C++

/*---------------------------------------------------------------------------*
Project: Horizon
File: CommonLogger.h
Copyright 2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Rev$
*---------------------------------------------------------------------------*/
#ifndef COMMONLOGGER_H_
#define COMMONLOGGER_H_
#include <nn.h>
#include "demo.h"
#include "SdLogger.h"
#include "LogConsole.h"
#define COMMON_LOGGER( ... ) (void)common::Logger::GetLoggerInstance()->Print(__VA_ARGS__)
#define COMMON_LOGGER_RESULT(result) \
(void)nn::dbg::PrintResult(result); \
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
#define COMMON_LOGGER_RESULT_WITH_LINE(result, line) \
(void)nn::dbg::PrintResult(result); \
(void)common::Logger::GetLoggerInstance()->PrintResult("line = %d\n", line); \
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
#define COMMON_LOGGER_RESULT_IF_FAILED(result) \
if(result.IsFailure()) \
{ \
COMMON_LOGGER_RESULT(result); \
} \
namespace common
{
namespace Logger
{
class CommonLogger
{
public:
CommonLogger();
~CommonLogger();
void Initialize(u32 width, u32 height, u32 maxLine, demo::RenderSystemDrawing* renderSystem);
void Finalize();
void Print(const char* fmt, ...);
void PrintResult(const char* fmt, ...);
void PrintResultIfFailed(nn::Result result, u32 line = 0);
void ScrollUp();
void ScrollDown();
void ScrollToBegin();
void ScrollToEnd();
void DrawConsole();
private:
nn::os::CriticalSection m_CriticalSection;
};
CommonLogger* GetLoggerInstance();
}
}
#endif /* COMMONLOGGER_H_ */