This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "krobot".
The branch, master has been updated
via c6ae35bf3d2cdae0486c1515706d70e85913070b (commit)
from 70a0dbab54eee22555b30b3f73c62a042e10289c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c6ae35bf3d2cdae0486c1515706d70e85913070b
Author: Jérémie Dimino <je...@di...>
Date: Wed Apr 13 14:53:56 2011 +0200
[krobot_viewer] show logs sent by other programs
-----------------------------------------------------------------------
Changes:
diff --git a/info/control2011/src/lib/krobot_service.ml b/info/control2011/src/lib/krobot_service.ml
index 348d139..9593dee 100644
--- a/info/control2011/src/lib/krobot_service.ml
+++ b/info/control2011/src/lib/krobot_service.ml
@@ -117,19 +117,16 @@ let init bus ?(fork=true) ?(kill=false) name =
let dbus_logger =
Lwt_log.make
(fun section level lines ->
- if level > Lwt_log.Info then
- let buf = Buffer.create 42 in
- let lines =
- List.map
- (fun line ->
- Buffer.clear buf;
- Lwt_log.render ~buffer:buf ~template:"$(level)@$(name)[$(section)]: $(message)" ~section ~level ~message:line;
- Buffer.contents buf)
- lines
- in
- OBus_signal.emit s_log obj (String.concat "\n" lines)
- else
- return ())
+ let buf = Buffer.create 42 in
+ let lines =
+ List.map
+ (fun line ->
+ Buffer.clear buf;
+ Lwt_log.render ~buffer:buf ~template:"$(name)[$(section)]: $(message)" ~section ~level ~message:line;
+ Buffer.contents buf)
+ lines
+ in
+ OBus_signal.emit s_log obj (String.concat "\n" lines))
return
in
diff --git a/info/control2011/src/services/krobot_service_planner.ml b/info/control2011/src/services/krobot_service_planner.ml
index bed9a94..4506831 100644
--- a/info/control2011/src/services/krobot_service_planner.ml
+++ b/info/control2011/src/services/krobot_service_planner.ml
@@ -271,6 +271,9 @@ options are:"
lwt () =
Arg.parse options ignore usage;
+ (* Display all informative messages. *)
+ Lwt_log.Section.set_level Lwt_log.Section.main Lwt_log.Info;
+
lwt bus = Krobot_bus.get () in
(* Create a new planner. *)
diff --git a/info/control2011/src/tools/krobot_viewer.ml b/info/control2011/src/tools/krobot_viewer.ml
index d93c17f..9b30a63 100644
--- a/info/control2011/src/tools/krobot_viewer.ml
+++ b/info/control2011/src/tools/krobot_viewer.ml
@@ -602,6 +602,7 @@ lwt () =
ignore (ui#window#connect#destroy ~callback:(wakeup wakener));
ui#window#show ();
+ (* Write logs to the log buffer. *)
Lwt_log.default :=
Lwt_log.broadcast [
!Lwt_log.default;
@@ -610,13 +611,22 @@ lwt () =
List.iter
(fun line ->
ui#logs#buffer#insert
- (Printf.sprintf "%s: %s\n" (Lwt_log.Section.name section) line))
+ (Printf.sprintf "krobot-viewer[%s]: %s\n" (Lwt_log.Section.name section) line))
lines;
ui#scrolled_logs#vadjustment#set_value ui#scrolled_logs#vadjustment#upper;
return ())
~close:return
];
+ (* Send logs received from other daemons to the log buffer. *)
+ lwt ev_logs = OBus_signal.connect (Krobot_service.log (Krobot_service.all bus)) in
+ E.keep
+ (E.map
+ (fun line ->
+ ui#logs#buffer#insert (line ^ "\n");
+ ui#scrolled_logs#vadjustment#set_value ui#scrolled_logs#vadjustment#upper)
+ ev_logs);
+
let lcd = LCD.create ui in
ignore (ui#lcd#event#connect#expose (fun ev -> LCD.draw lcd; true));
hooks/post-receive
--
krobot
|