/** @file DebugPrintTest.c @brief DHL_MODULE ¹× ModulePrint °ü·Ã API Å×½ºÆ®. */ #include "DHL_OSAL.h" #include "DHL_DBG.h" //DHL_MODULE("DbgTest", 0); void DebugPrint_Test(void) { int mlevel, plevel; DHL_OS_Printf("This is DbgPrint test. file %s, line %d\n", __FILE__, __LINE__); // default level test.. // ÀÌ Å×½ºÆ® ÇÔ¼ö Àü¿¡ ¾î¶² »óȲÀ̳Ŀ¡ µû¶ó Ãâ·Â °á°ú´Â ´Þ¶óÁú ¼öÀÖ´Ù. // ¸¸¾à ÃÖÃÊ ½ÇÇàÇÏ´Â °æ¿ì¶ó¸é print level 0 ¸¸ º¸¿©¾ß ÇÑ´Ù. // DHL_OS_Printf("=== initless print test\n"); for (plevel=0; plevel<6; plevel++) { dprint(plevel, "print without init, in print level %d\n", plevel); } // °¢ ¸ðµâ º° Ãâ·Â Å×½ºÆ®.. for (mlevel=-1; mlevel<=6; mlevel++) { DHL_OS_Printf("=== changing module level to %d\n", mlevel); DHL_DBG_SetModuleLevel("DbgTest", mlevel); for (plevel=0; plevel<=6; plevel++) { dprint(plevel, " print level %d. %s\n", plevel, plevel <= mlevel ? "it should be seen" : "MUST NOT BE SEEN!"); } } DHL_OS_Printf("=== register many modules..\n"); DHL_DBG_SetModuleLevel("DbgTest1", 1); DHL_DBG_SetModuleLevel("DbgTest2", 2); DHL_DBG_SetModuleLevel("Another1", 3); DHL_DBG_SetModuleLevel("Another2", 4); DHL_OS_Printf("=== all module list \n"); DHL_DBG_PrintModuleLevel(""); DHL_OS_Printf("=== module list containing 'Dbg'\n"); DHL_DBG_PrintModuleLevel("Dbg"); DHL_OS_Printf("test end. Press any key to continue..\n"); DHL_OS_GetChar(); } /* Å×½ºÆ® °á°ú: This is DbgPrint test. file ../dhl/api/test/DebugPrintTest.c, line 21 === initless print test [DbgTest ?? 0x20] 6965 print without init, in print level 0 [DbgTest ?? 0x20] 6971 print without init, in print level 1 [DbgTest ?? 0x20] 6976 print without init, in print level 2 [DbgTest ?? 0x20] 6982 print without init, in print level 3 [DbgTest ?? 0x20] 6988 print without init, in print level 4 [DbgTest ?? 0x20] 6994 print without init, in print level 5 === changing module level to -1 dbg module 'DbgTest' level changed to -1 === changing module level to 0 dbg module 'DbgTest' level changed to 0 [DbgTest ?? 0x20] 7014 print level 0. it should be seen === changing module level to 1 dbg module 'DbgTest' level changed to 1 [DbgTest ?? 0x20] 7027 print level 0. it should be seen [DbgTest ?? 0x20] 7032 print level 1. it should be seen === changing module level to 2 dbg module 'DbgTest' level changed to 2 [DbgTest ?? 0x20] 7045 print level 0. it should be seen [DbgTest ?? 0x20] 7050 print level 1. it should be seen [DbgTest ?? 0x20] 7056 print level 2. it should be seen === changing module level to 3 dbg module 'DbgTest' level changed to 3 [DbgTest ?? 0x20] 7068 print level 0. it should be seen [DbgTest ?? 0x20] 7074 print level 1. it should be seen [DbgTest ?? 0x20] 7080 print level 2. it should be seen [DbgTest ?? 0x20] 7085 print level 3. it should be seen === changing module level to 4 dbg module 'DbgTest' level changed to 4 [DbgTest ?? 0x20] 7098 print level 0. it should be seen [DbgTest ?? 0x20] 7103 print level 1. it should be seen [DbgTest ?? 0x20] 7109 print level 2. it should be seen [DbgTest ?? 0x20] 7114 print level 3. it should be seen [DbgTest ?? 0x20] 7120 print level 4. it should be seen === changing module level to 5 dbg module 'DbgTest' level changed to 5 [DbgTest ?? 0x20] 7132 print level 0. it should be seen [DbgTest ?? 0x20] 7138 print level 1. it should be seen [DbgTest ?? 0x20] 7144 print level 2. it should be seen [DbgTest ?? 0x20] 7149 print level 3. it should be seen [DbgTest ?? 0x20] 7155 print level 4. it should be seen [DbgTest ?? 0x20] 7160 print level 5. it should be seen === changing module level to 6 dbg module 'DbgTest' level changed to 6 [DbgTest ?? 0x20] 7173 print level 0. it should be seen [DbgTest ?? 0x20] 7178 print level 1. it should be seen [DbgTest ?? 0x20] 7184 print level 2. it should be seen [DbgTest ?? 0x20] 7190 print level 3. it should be seen [DbgTest ?? 0x20] 7195 print level 4. it should be seen [DbgTest ?? 0x20] 7201 print level 5. it should be seen [DbgTest ?? 0x20] 7206 print level 6. it should be seen === register many modules.. dbg module 'DbgTest1' level changed to 1 dbg module 'DbgTest2' level changed to 2 dbg module 'Another1' level changed to 3 dbg module 'Another2' level changed to 4 === all module list =================================== ( 0) *fe : 0 ( 1) DbgTest : 6 ( 2) DbgTest1 : 1 ( 3) DbgTest2 : 2 ( 4) Another1 : 3 ( 5) Another2 : 4 =================================== 6 modules === module list containing 'Dbg' modules that contains 'Dbg' =================================== ( 1) DbgTest : 6 ( 2) DbgTest1 : 1 ( 3) DbgTest2 : 2 =================================== 3 modules test end. Press any key to continue.. */ void DHL_DebugPrintTest(void) { // blank. only for linking. }