Kouhei Sutou
null+****@clear*****
Wed Jun 10 12:20:50 JST 2015
Kouhei Sutou 2015-06-10 12:20:50 +0900 (Wed, 10 Jun 2015) New Revision: 0973080e54ab55976f7333ec3f9b3a09cc58f429 https://github.com/groonga/groonga/commit/0973080e54ab55976f7333ec3f9b3a09cc58f429 Message: Don't set the default logger path for library use It's backward incompatible change. But it will not effect to many users. Server use (groonga command, Mroonga, PGroonga and so on) users can get log by default. In server use, developers set up log in their software. Most library use (Rroonga, groonga-gobject and so on) users couldn't get log by default with earlier versions. The default log path is system path such as /var/log/groonga/groonga.log. It's not writable for normal users. Modified files: lib/logger.c src/grndb.c src/grnslap.c src/groonga.c src/groonga_benchmark.c src/groonga_mruby.c Modified: lib/logger.c (+0 -3) =================================================================== --- lib/logger.c 2015-06-10 12:19:57 +0900 (ee0199e) +++ lib/logger.c 2015-06-10 12:20:50 +0900 (5a85de3) @@ -314,9 +314,6 @@ grn_logger_put(grn_ctx *ctx, grn_log_level level, void grn_logger_init(void) { - if (!default_logger_path) { - default_logger_path = grn_strdup_raw(GRN_LOG_PATH); - } grn_memcpy(¤t_logger, &default_logger, sizeof(grn_logger)); CRITICAL_SECTION_INIT(default_logger_lock); } Modified: src/grndb.c (+2 -0) =================================================================== --- src/grndb.c 2015-06-10 12:19:57 +0900 (d493338) +++ src/grndb.c 2015-06-10 12:20:50 +0900 (d5a353e) @@ -120,6 +120,8 @@ main(int argc, char **argv) { int exit_code = EXIT_SUCCESS; + grn_default_logger_set_path(GRN_LOG_PATH); + if (grn_init() != GRN_SUCCESS) { return EXIT_FAILURE; } Modified: src/grnslap.c (+2 -0) =================================================================== --- src/grnslap.c 2015-06-10 12:19:57 +0900 (a5095a7) +++ src/grnslap.c 2015-06-10 12:20:50 +0900 (f9eee10) @@ -362,6 +362,8 @@ main(int argc, char **argv) flags |= flag_usage; } + grn_default_logger_set_path(GRN_LOG_PATH); + if (grn_init()) { return -1; } if (flags & flag_usage) { usage(); r = -1; Modified: src/groonga.c (+1 -1) =================================================================== --- src/groonga.c 2015-06-10 12:19:57 +0900 (7259095) +++ src/groonga.c 2015-06-10 12:20:50 +0900 (121ad9f) @@ -2658,7 +2658,7 @@ main(int argc, char **argv) const char *bind_address_arg = NULL; const char *hostname_arg = NULL; const char *protocol_arg = NULL; - const char *log_path_arg = NULL; + const char *log_path_arg = GRN_LOG_PATH; const char *log_rotate_threshold_size_arg = NULL; const char *query_log_path_arg = NULL; const char *query_log_rotate_threshold_size_arg = NULL; Modified: src/groonga_benchmark.c (+2 -0) =================================================================== --- src/groonga_benchmark.c 2015-06-10 12:19:57 +0900 (32438bf) +++ src/groonga_benchmark.c 2015-06-10 12:20:50 +0900 (2ebca38) @@ -3062,6 +3062,8 @@ main(int argc, char **argv) grntest_outtype = OUT_TSV; } + grn_default_logger_set_path(GRN_LOG_PATH); + grn_init(); CRITICAL_SECTION_INIT(grntest_cs); Modified: src/groonga_mruby.c (+2 -0) =================================================================== --- src/groonga_mruby.c 2015-06-10 12:19:57 +0900 (9978a00) +++ src/groonga_mruby.c 2015-06-10 12:20:50 +0900 (2f442fb) @@ -67,6 +67,8 @@ main(int argc, char **argv) return EXIT_FAILURE; } + grn_default_logger_set_path(GRN_LOG_PATH); + if (grn_init() != GRN_SUCCESS) { return EXIT_FAILURE; } -------------- next part -------------- HTML����������������������������...Download