diff options
| author | 2014-12-06 21:14:14 -0200 | |
|---|---|---|
| committer | 2014-12-13 02:08:06 -0200 | |
| commit | 4d2a6f8b9b3eeb85574a5e4f93422ffd4feebcd3 (patch) | |
| tree | 1e3fd71256c04a15970b09abd3f7280f8b1ff678 /src/common/log.h | |
| parent | Add configurable per-class log filtering (diff) | |
| download | yuzu-4d2a6f8b9b3eeb85574a5e4f93422ffd4feebcd3.tar.gz yuzu-4d2a6f8b9b3eeb85574a5e4f93422ffd4feebcd3.tar.xz yuzu-4d2a6f8b9b3eeb85574a5e4f93422ffd4feebcd3.zip | |
Remove old logging system
Diffstat (limited to 'src/common/log.h')
| -rw-r--r-- | src/common/log.h | 127 |
1 files changed, 2 insertions, 125 deletions
diff --git a/src/common/log.h b/src/common/log.h index c0f7ca2df..663eda9ad 100644 --- a/src/common/log.h +++ b/src/common/log.h | |||
| @@ -8,132 +8,13 @@ | |||
| 8 | #include "common/msg_handler.h" | 8 | #include "common/msg_handler.h" |
| 9 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| 10 | 10 | ||
| 11 | #ifndef LOGGING | ||
| 12 | #define LOGGING | ||
| 13 | #endif | ||
| 14 | |||
| 15 | enum { | ||
| 16 | OS_LEVEL, // Printed by the emulated operating system | ||
| 17 | NOTICE_LEVEL, // VERY important information that is NOT errors. Like startup and OSReports. | ||
| 18 | ERROR_LEVEL, // Critical errors | ||
| 19 | WARNING_LEVEL, // Something is suspicious. | ||
| 20 | INFO_LEVEL, // General information. | ||
| 21 | DEBUG_LEVEL, // Detailed debugging - might make things slow. | ||
| 22 | }; | ||
| 23 | |||
| 24 | namespace LogTypes | ||
| 25 | { | ||
| 26 | |||
| 27 | enum LOG_TYPE { | ||
| 28 | //ACTIONREPLAY, | ||
| 29 | //AUDIO, | ||
| 30 | //AUDIO_INTERFACE, | ||
| 31 | BOOT, | ||
| 32 | //COMMANDPROCESSOR, | ||
| 33 | COMMON, | ||
| 34 | //CONSOLE, | ||
| 35 | CONFIG, | ||
| 36 | //DISCIO, | ||
| 37 | //FILEMON, | ||
| 38 | //DSPHLE, | ||
| 39 | //DSPLLE, | ||
| 40 | //DSP_MAIL, | ||
| 41 | //DSPINTERFACE, | ||
| 42 | //DVDINTERFACE, | ||
| 43 | //DYNA_REC, | ||
| 44 | //EXPANSIONINTERFACE, | ||
| 45 | //GDB_STUB, | ||
| 46 | ARM11, | ||
| 47 | GSP, | ||
| 48 | OSHLE, | ||
| 49 | MASTER_LOG, | ||
| 50 | MEMMAP, | ||
| 51 | //MEMCARD_MANAGER, | ||
| 52 | //OSREPORT, | ||
| 53 | //PAD, | ||
| 54 | //PROCESSORINTERFACE, | ||
| 55 | //PIXELENGINE, | ||
| 56 | //SERIALINTERFACE, | ||
| 57 | //SP1, | ||
| 58 | //STREAMINGINTERFACE, | ||
| 59 | VIDEO, | ||
| 60 | //VIDEOINTERFACE, | ||
| 61 | LOADER, | ||
| 62 | FILESYS, | ||
| 63 | //WII_IPC_DVD, | ||
| 64 | //WII_IPC_ES, | ||
| 65 | //WII_IPC_FILEIO, | ||
| 66 | //WII_IPC_HID, | ||
| 67 | KERNEL, | ||
| 68 | SVC, | ||
| 69 | HLE, | ||
| 70 | RENDER, | ||
| 71 | GPU, | ||
| 72 | HW, | ||
| 73 | TIME, | ||
| 74 | //NETPLAY, | ||
| 75 | GUI, | ||
| 76 | |||
| 77 | NUMBER_OF_LOGS // Must be last | ||
| 78 | }; | ||
| 79 | |||
| 80 | // FIXME: should this be removed? | ||
| 81 | enum LOG_LEVELS { | ||
| 82 | LOS = OS_LEVEL, | ||
| 83 | LNOTICE = NOTICE_LEVEL, | ||
| 84 | LERROR = ERROR_LEVEL, | ||
| 85 | LWARNING = WARNING_LEVEL, | ||
| 86 | LINFO = INFO_LEVEL, | ||
| 87 | LDEBUG = DEBUG_LEVEL, | ||
| 88 | }; | ||
| 89 | |||
| 90 | #define LOGTYPES_LEVELS LogTypes::LOG_LEVELS | ||
| 91 | #define LOGTYPES_TYPE LogTypes::LOG_TYPE | ||
| 92 | |||
| 93 | } // namespace | ||
| 94 | |||
| 95 | void GenericLog(LOGTYPES_LEVELS level, LOGTYPES_TYPE type, const char*file, int line, | ||
| 96 | const char* function, const char* fmt, ...) | ||
| 97 | #ifdef __GNUC__ | ||
| 98 | __attribute__((format(printf, 6, 7))) | ||
| 99 | #endif | ||
| 100 | ; | ||
| 101 | |||
| 102 | #if defined LOGGING || defined _DEBUG || defined DEBUGFAST | ||
| 103 | #define MAX_LOGLEVEL LDEBUG | ||
| 104 | #else | ||
| 105 | #ifndef MAX_LOGLEVEL | ||
| 106 | #define MAX_LOGLEVEL LWARNING | ||
| 107 | #endif // loglevel | ||
| 108 | #endif // logging | ||
| 109 | |||
| 110 | #ifdef _WIN32 | 11 | #ifdef _WIN32 |
| 111 | #ifndef __func__ | 12 | #ifndef __func__ |
| 112 | #define __func__ __FUNCTION__ | 13 | #define __func__ __FUNCTION__ |
| 113 | #endif | 14 | #endif |
| 114 | #endif | 15 | #endif |
| 115 | 16 | ||
| 116 | // Let the compiler optimize this out | 17 | #if _DEBUG |
| 117 | #define GENERIC_LOG(t, v, ...) { \ | ||
| 118 | if (v <= LogTypes::MAX_LOGLEVEL) \ | ||
| 119 | GenericLog(v, t, __FILE__, __LINE__, __func__, __VA_ARGS__); \ | ||
| 120 | } | ||
| 121 | |||
| 122 | //#define OS_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LOS, __VA_ARGS__) } while (0) | ||
| 123 | //#define ERROR_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__) } while (0) | ||
| 124 | //#define WARN_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__) } while (0) | ||
| 125 | //#define NOTICE_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__) } while (0) | ||
| 126 | //#define INFO_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__) } while (0) | ||
| 127 | //#define DEBUG_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__) } while (0) | ||
| 128 | |||
| 129 | //#define OS_LOG(t,...) LOG_INFO(Common, __VA_ARGS__) | ||
| 130 | //#define ERROR_LOG(t,...) LOG_ERROR(Common_Filesystem, __VA_ARGS__) | ||
| 131 | //#define WARN_LOG(t,...) LOG_WARNING(Kernel_SVC, __VA_ARGS__) | ||
| 132 | //#define NOTICE_LOG(t,...) LOG_INFO(Service, __VA_ARGS__) | ||
| 133 | //#define INFO_LOG(t,...) LOG_INFO(Service_FS, __VA_ARGS__) | ||
| 134 | //#define DEBUG_LOG(t,...) LOG_DEBUG(Common, __VA_ARGS__) | ||
| 135 | |||
| 136 | #if MAX_LOGLEVEL >= DEBUG_LEVEL | ||
| 137 | #define _dbg_assert_(_t_, _a_) \ | 18 | #define _dbg_assert_(_t_, _a_) \ |
| 138 | if (!(_a_)) {\ | 19 | if (!(_a_)) {\ |
| 139 | LOG_CRITICAL(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ | 20 | LOG_CRITICAL(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ |
| @@ -154,11 +35,10 @@ void GenericLog(LOGTYPES_LEVELS level, LOGTYPES_TYPE type, const char*file, int | |||
| 154 | #define _dbg_assert_(_t_, _a_) {} | 35 | #define _dbg_assert_(_t_, _a_) {} |
| 155 | #define _dbg_assert_msg_(_t_, _a_, _desc_, ...) {} | 36 | #define _dbg_assert_msg_(_t_, _a_, _desc_, ...) {} |
| 156 | #endif // dbg_assert | 37 | #endif // dbg_assert |
| 157 | #endif // MAX_LOGLEVEL DEBUG | 38 | #endif |
| 158 | 39 | ||
| 159 | #define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_) | 40 | #define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_) |
| 160 | 41 | ||
| 161 | #ifndef GEKKO | ||
| 162 | #ifdef _WIN32 | 42 | #ifdef _WIN32 |
| 163 | #define _assert_msg_(_t_, _a_, _fmt_, ...) \ | 43 | #define _assert_msg_(_t_, _a_, _fmt_, ...) \ |
| 164 | if (!(_a_)) {\ | 44 | if (!(_a_)) {\ |
| @@ -170,6 +50,3 @@ void GenericLog(LOGTYPES_LEVELS level, LOGTYPES_TYPE type, const char*file, int | |||
| 170 | if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \ | 50 | if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \ |
| 171 | } | 51 | } |
| 172 | #endif // WIN32 | 52 | #endif // WIN32 |
| 173 | #else // GEKKO | ||
| 174 | #define _assert_msg_(_t_, _a_, _fmt_, ...) | ||
| 175 | #endif | ||