|
From: Kouhei S. <nul...@cl...> - 2013-11-17 14:35:33
|
Kouhei Sutou 2013-11-17 23:35:12 +0900 (Sun, 17 Nov 2013) New Revision: 0443b9eaddf2801c1bd3bdce2370c509de77e6e3 https://github.com/clear-code/cutter/commit/0443b9eaddf2801c1bd3bdce2370c509de77e6e3 Message: logger: remove unused log levels Modified files: cutter/cut-logger.c cutter/cut-logger.h test/cutter/test-cut-logger.c Modified: cutter/cut-logger.c (+2 -9) =================================================================== --- cutter/cut-logger.c 2013-11-17 23:26:06 +0900 (99feaf6) +++ cutter/cut-logger.c 2013-11-17 23:35:12 +0900 (7762cae) @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* - * Copyright (C) 2012 Kouhei Sutou <ko...@cl...> + * Copyright (C) 2012-2013 Kouhei Sutou <ko...@cl...> * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -39,8 +39,7 @@ (CUT_LOG_LEVEL_CRITICAL | \ CUT_LOG_LEVEL_ERROR | \ CUT_LOG_LEVEL_WARNING | \ - CUT_LOG_LEVEL_MESSAGE | \ - CUT_LOG_LEVEL_STATISTICS) + CUT_LOG_LEVEL_MESSAGE) #define DEFAULT_ITEM \ (CUT_LOG_ITEM_TIME) @@ -457,12 +456,6 @@ log_message_colorize_console (GString *log, case CUT_LOG_LEVEL_TRACE: color = WHITE_COLOR MAGENTA_BACK_COLOR; break; - case CUT_LOG_LEVEL_STATISTICS: - color = BLUE_COLOR WHITE_BACK_COLOR; - break; - case CUT_LOG_LEVEL_PROFILE: - color = GREEN_COLOR BLACK_BACK_COLOR; - break; default: color = NULL; break; Modified: cutter/cut-logger.h (+3 -15) =================================================================== --- cutter/cut-logger.h 2013-11-17 23:26:06 +0900 (814ee9b) +++ cutter/cut-logger.h 2013-11-17 23:35:12 +0900 (ff772cc) @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* - * Copyright (C) 2012 Kouhei Sutou <ko...@cl...> + * Copyright (C) 2012-2013 Kouhei Sutou <ko...@cl...> * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -51,10 +51,6 @@ do { \ cut_log(CUT_LOG_LEVEL_DEBUG, format, ## __VA_ARGS__) #define cut_log_trace(format, ...) \ cut_log(CUT_LOG_LEVEL_TRACE, format, ## __VA_ARGS__) -#define cut_log_statistics(format, ...) \ - cut_log(CUT_LOG_LEVEL_STATISTICS, format, ## __VA_ARGS__) -#define cut_log_profile(format, ...) \ - cut_log(CUT_LOG_LEVEL_PROFILE, format, ## __VA_ARGS__) #define cut_set_log_level(level) \ cut_logger_set_target_level(cut_logger(), (level)) @@ -79,10 +75,6 @@ do { \ (cut_need_log(CUT_LOG_LEVEL_DEBUG)) #define cut_need_trace_log() \ (cut_need_log(CUT_LOG_LEVEL_TRACE)) -#define cut_need_statistics_log() \ - (cut_need_log(CUT_LOG_LEVEL_STATISTICS)) -#define cut_need_profile_log() \ - (cut_need_log(CUT_LOG_LEVEL_PROFILE)) #define CUT_TYPE_LOGGER (cut_logger_get_type()) #define CUT_LOGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CUT_TYPE_LOGGER, CutLogger)) @@ -101,9 +93,7 @@ typedef enum CUT_LOG_LEVEL_MESSAGE = 1 << 4, CUT_LOG_LEVEL_INFO = 1 << 5, CUT_LOG_LEVEL_DEBUG = 1 << 6, - CUT_LOG_LEVEL_TRACE = 1 << 7, - CUT_LOG_LEVEL_STATISTICS = 1 << 8, - CUT_LOG_LEVEL_PROFILE = 1 << 9 + CUT_LOG_LEVEL_TRACE = 1 << 7 } CutLogLevelFlags; #define CUT_LOG_LEVEL_ALL (CUT_LOG_LEVEL_CRITICAL | \ @@ -112,9 +102,7 @@ typedef enum CUT_LOG_LEVEL_MESSAGE | \ CUT_LOG_LEVEL_INFO | \ CUT_LOG_LEVEL_DEBUG | \ - CUT_LOG_LEVEL_TRACE | \ - CUT_LOG_LEVEL_STATISTICS | \ - CUT_LOG_LEVEL_PROFILE) + CUT_LOG_LEVEL_TRACE) #define CUT_LOG_NULL_SAFE_STRING(string) ((string) ? (string) : "(null)") Modified: test/cutter/test-cut-logger.c (+7 -11) =================================================================== --- test/cutter/test-cut-logger.c 2013-11-17 23:26:06 +0900 (b5dc34a) +++ test/cutter/test-cut-logger.c 2013-11-17 23:35:12 +0900 (4f8ebef) @@ -1,6 +1,6 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* - * Copyright (C) 2012 Kouhei Sutou <ko...@cl...> + * Copyright (C) 2012-2013 Kouhei Sutou <ko...@cl...> * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -128,13 +128,11 @@ data_level_from_string (void) CUT_LOG_LEVEL_WARNING | CUT_LOG_LEVEL_MESSAGE | CUT_LOG_LEVEL_INFO | - CUT_LOG_LEVEL_DEBUG | - CUT_LOG_LEVEL_STATISTICS, + CUT_LOG_LEVEL_DEBUG, "+info|debug"); ADD("remove", CUT_LOG_LEVEL_CRITICAL | - CUT_LOG_LEVEL_MESSAGE | - CUT_LOG_LEVEL_STATISTICS, + CUT_LOG_LEVEL_MESSAGE, "-error|warning"); #undef ADD @@ -291,15 +289,13 @@ test_interesting_level (void) CUT_LOG_LEVEL_MESSAGE | CUT_LOG_LEVEL_WARNING | CUT_LOG_LEVEL_ERROR | - CUT_LOG_LEVEL_CRITICAL | - CUT_LOG_LEVEL_STATISTICS, + CUT_LOG_LEVEL_CRITICAL, cut_logger_get_interesting_level(logger)); cut_logger_set_target_level(logger, - CUT_LOG_LEVEL_INFO | - CUT_LOG_LEVEL_STATISTICS); + CUT_LOG_LEVEL_INFO | CUT_LOG_LEVEL_TRACE); gcut_assert_equal_flags(CUT_TYPE_LOG_LEVEL_FLAGS, - CUT_LOG_LEVEL_INFO | CUT_LOG_LEVEL_STATISTICS, + CUT_LOG_LEVEL_INFO | CUT_LOG_LEVEL_TRACE, cut_logger_get_interesting_level(logger)); cut_logger_set_interesting_level(logger, @@ -308,7 +304,7 @@ test_interesting_level (void) gcut_assert_equal_flags(CUT_TYPE_LOG_LEVEL_FLAGS, CUT_LOG_LEVEL_INFO | CUT_LOG_LEVEL_DEBUG | - CUT_LOG_LEVEL_STATISTICS, + CUT_LOG_LEVEL_TRACE, cut_logger_get_interesting_level(logger)); } |