added 'application' logging channel
@@ -116,6 +116,7 @@ pub fn initialize<A: Allocate>(root: &mut Root<A>) {
PROGRESS.with(|x| x.set(File::create(format!("logs/progress-{}.abom", root.index())).unwrap()));
PUSH_PROGRESS.with(|x| x.set(File::create(format!("logs/push_progress-{}.abom", root.index())).unwrap()));
SCHEDULE.with(|x| x.set(File::create(format!("logs/schedule-{}.abom", root.index())).unwrap()));
+ APPLICATION.with(|x| x.set(File::create(format!("logs/application-{}.abom", root.index())).unwrap()));
GUARDED_MESSAGE.with(|x| x.set(File::create(format!("logs/guarded_message-{}.abom", root.index())).unwrap()));
GUARDED_PROGRESS.with(|x| x.set(File::create(format!("logs/guarded_progress-{}.abom", root.index())).unwrap()));
@@ -137,6 +138,7 @@ pub fn flush_logs() {
PUSH_PROGRESS.with(|x| x.flush());
MESSAGES.with(|x| x.flush());
SCHEDULE.with(|x| x.flush());
+ APPLICATION.with(|x| x.flush());
GUARDED_MESSAGE.with(|x| x.flush());
GUARDED_PROGRESS.with(|x| x.flush());
}
@@ -154,6 +156,8 @@ thread_local!{
pub static MESSAGES: EventStreamLogger<MessagesEvent, File> = EventStreamLogger::new();
/// Logs operator scheduling.
pub static SCHEDULE: EventStreamLogger<ScheduleEvent, File> = EventStreamLogger::new();
+ /// Logs application events.
+ pub static APPLICATION: EventStreamLogger<ApplicationEvent, File> = EventStreamLogger::new());
/// Logs delivery of message to an operator input.
pub static GUARDED_MESSAGE: EventStreamLogger<bool, File> = EventStreamLogger::new();
/// Logs delivery of notification to an operator.
@@ -283,3 +287,14 @@ pub struct ScheduleEvent {
}
unsafe_abomonate!(ScheduleEvent : id, start_stop);
+
+#[derive(Debug, Clone)]
+/// Application-defined code startor stop
+pub struct ApplicationEvent {
+ /// Unique event type identifier
+ pub id: usize,
+ /// True when activity begins, false when it stops
+ pub is_start: bool,
+}
+
+unsafe_abomonate!(ApplicationEvent: id, is_start);
