Permalink
Browse files

Move parsing of disable_logging_for config into utils.

Signed-off-by: Rok Strniša <rok.strnisa@citrix.com>
  • Loading branch information...
1 parent f87bb30 commit 536b66e555c9f16e898559843a31c13eee06b520 @rokstrnisa rokstrnisa committed Jun 30, 2012
Showing with 35 additions and 12 deletions.
  1. +33 −0 ocaml/util/config_shared.ml
  2. +1 −0 ocaml/xapi/OMakefile
  3. +1 −12 ocaml/xapi/xapi_config.ml
@@ -0,0 +1,33 @@
+(*
+ * Copyright (C) Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+open Stringext
+
+module D = Debug.Debugger(struct let name = "config_shared" end)
+open D
+
+let disable_logging_for =
+ "disable-logging-for", Config.String
+ (fun x ->
+ try
+ let modules = String.split_f String.isspace x in
+ List.iter
+ (fun x ->
+ debug "Disabling logging for: %s" x;
+ Debug.disable x
+ ) modules
+ with e ->
+ error "Processing disabled-logging-for = %s" x;
+ log_backtrace ()
+ )
View
@@ -253,6 +253,7 @@ XAPI_MODULES = $(COMMON) \
../license/v6rpc \
../license/v6errors \
bios_strings \
+ ../util/config_shared \
xapi_config \
features \
pool_features \
View
@@ -24,18 +24,7 @@ open D
let read_config filename =
let configargs = [
"use-xenopsd", Config.Set_bool Xapi_globs.use_xenopsd;
- "disable-logging-for", Config.String
- (fun x ->
- try
- let modules = String.split_f String.isspace x in
- List.iter
- (fun x ->
- debug "Disabling logging for: %s" x;
- Debug.disable x
- ) modules
- with e ->
- error "Processing disabled-logging-for = %s: %s" x (Printexc.to_string e)
- )
+ Config_shared.disable_logging_for;
] in
try
Config.read filename configargs (fun _ _ -> ())

0 comments on commit 536b66e

Please sign in to comment.