|
40 | 40 | #include "scene/main/node.h" |
41 | 41 | #endif |
42 | 42 |
|
43 | | -int repetitions_last_line = -1; |
44 | | -const char *repetitions_last_function = NULL; |
45 | | -// No need to initialize: by constructon, can never be checked if line/function don't match. |
46 | | -char repetitions_last_message[256]; |
47 | | -int repetitions_last_message_count = 0; |
48 | | -const int MAX_LOG_MESSAGE_REPETITIONS = 6; |
49 | | -const char *REPETITIONS_WARNING_MESSAGE = "Last message repeated 6 times..."; |
50 | | - |
51 | 43 | static ErrorHandlerList *error_handler_list = nullptr; |
52 | 44 |
|
53 | 45 | void add_error_handler(ErrorHandlerList *p_handler) { |
@@ -106,25 +98,6 @@ void _err_print_error(const char *p_function, const char *p_file, int p_line, co |
106 | 98 | } |
107 | 99 |
|
108 | 100 | _global_lock(); |
109 | | - |
110 | | - if (repetitions_last_line == p_line && repetitions_last_function == p_function && ::strcmp(p_message, repetitions_last_message) == 0) { |
111 | | - if (repetitions_last_message_count == MAX_LOG_MESSAGE_REPETITIONS) { |
112 | | - p_message = REPETITIONS_WARNING_MESSAGE; |
113 | | - repetitions_last_message_count += 1; // avoid rollover errors |
114 | | - } else if (repetitions_last_message_count < MAX_LOG_MESSAGE_REPETITIONS) { |
115 | | - repetitions_last_message_count += 1; |
116 | | - } else { |
117 | | - _global_unlock(); |
118 | | - return; |
119 | | - } |
120 | | - } else { |
121 | | - repetitions_last_message_count = 0; |
122 | | - repetitions_last_line = p_line; |
123 | | - repetitions_last_function = p_function; |
124 | | - // The message memory lifetime may end after this call. |
125 | | - ::strncpy(repetitions_last_message, p_message, sizeof(repetitions_last_message)); |
126 | | - } |
127 | | - |
128 | 101 | ErrorHandlerList *l = error_handler_list; |
129 | 102 | while (l) { |
130 | 103 | l->errfunc(l->userdata, p_function, p_file, p_line, p_error, p_message, p_editor_notify, p_type); |
|
0 commit comments