Created
August 5, 2014 14:28
-
-
Save hirosof/253578da507e5b7069f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "CHSSimpleLogger.h" | |
| CHSSimpleLogger sl; //ログクラス | |
| //実験用名前空間と関数 | |
| namespace MyNamespace { | |
| void Go(void) { | |
| int LoopNum = 21; | |
| for (int i = 0; i < LoopNum; i++) { | |
| sl.WriteForFuncInNamespace(TEXT("MyNamespace"), TEXT("Go"), TEXT("2^%d = %d"), i, 1 << i); | |
| } | |
| } | |
| } | |
| //実験用クラス | |
| class CMyClass { | |
| public: | |
| CMyClass() { sl.Write(TEXT("CMyClass"), nullptr, TEXT("CMyClass 初期化完了")); } | |
| ~CMyClass() {} | |
| void Run(void) { | |
| int LoopNum = 15; | |
| for (int i = 0; i < LoopNum; i++) { | |
| sl.Write(TEXT("CMyClass"),TEXT("Run"), TEXT("%d / %dのループ"), i + 1, LoopNum); | |
| } | |
| } | |
| }; | |
| //実験用関数 | |
| void Test(void) { | |
| int LoopNum = 5; | |
| for (int i = 0; i < LoopNum; i++) { | |
| sl.Write(TEXT("Test"), TEXT("%d / %dのループ"), i + 1, LoopNum); | |
| } | |
| } | |
| //実験コード付きメイン関数 | |
| int main(void) { | |
| sl.Create(TEXT("TestLog.txt")); | |
| CMyClass cmc; | |
| int LoopNum = 10; | |
| for (int i = 0; i < LoopNum; i++) { | |
| sl.Write(TEXT("%d / %dのループ"), i + 1, LoopNum); | |
| } | |
| Test(); | |
| cmc.Run(); | |
| MyNamespace::Go(); | |
| return 0; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment