[Groonga-commit] groonga/groonga [master] Add max_level accessor for the current logger

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Apr 8 23:10:44 JST 2013


Kouhei Sutou	2013-04-08 23:10:44 +0900 (Mon, 08 Apr 2013)

  New Revision: 5640a4d6dced75317cabe7678819f668467bb08c
  https://github.com/groonga/groonga/commit/5640a4d6dced75317cabe7678819f668467bb08c

  Message:
    Add max_level accessor for the current logger

  Modified files:
    include/groonga.h
    lib/ctx.c

  Modified: include/groonga.h (+3 -0)
===================================================================
--- include/groonga.h    2013-04-07 11:39:11 +0900 (88e5cd6)
+++ include/groonga.h    2013-04-08 23:10:44 +0900 (b0ae406)
@@ -2084,6 +2084,9 @@ struct _grn_logger {
 
 GRN_API grn_rc grn_logger_set(grn_ctx *ctx, const grn_logger *logger);
 
+GRN_API void grn_logger_set_max_level(grn_ctx *ctx, grn_log_level max_level);
+GRN_API grn_log_level grn_logger_get_max_level(grn_ctx *ctx);
+
 #ifdef __GNUC__
 #define GRN_ATTRIBUTE_PRINTF(fmt_pos) \
   __attribute__ ((format(printf, fmt_pos, fmt_pos + 1)))

  Modified: lib/ctx.c (+12 -0)
===================================================================
--- lib/ctx.c    2013-04-07 11:39:11 +0900 (ddff3b5)
+++ lib/ctx.c    2013-04-08 23:10:44 +0900 (c6dc237)
@@ -853,6 +853,18 @@ grn_logger_set(grn_ctx *ctx, const grn_logger *logger)
   return GRN_SUCCESS;
 }
 
+void
+grn_logger_set_max_level(grn_ctx *ctx, grn_log_level max_level)
+{
+  current_logger.max_level = max_level;
+}
+
+grn_log_level
+grn_logger_get_max_level(grn_ctx *ctx)
+{
+  return current_logger.max_level;
+}
+
 int
 grn_logger_pass(grn_ctx *ctx, grn_log_level level)
 {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index