From 5bddcf5fb201097c560a43e954945fd86bd4aab5 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 11 Apr 2013 15:19:31 -0400 Subject: [PATCH] Extra logging --- marketplace/process.rkt | 6 +++++- marketplace/roles.rkt | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/marketplace/process.rkt b/marketplace/process.rkt index 914a1ec..4b80856 100644 --- a/marketplace/process.rkt +++ b/marketplace/process.rkt @@ -4,6 +4,7 @@ (require "types.rkt") (require "roles.rkt") (require "vm.rkt") +(require "log-typed.rkt") (require (rename-in "tr-struct-copy.rkt" [tr-struct-copy struct-copy])) ;; PR13149 workaround (provide send-to-user @@ -24,7 +25,10 @@ (log-error "Process ~v(~v):~n~v~n" debug-name pid e)) failure-result)]) - enclosed-expr)) + (matrix-log 'debug "Entering process ~v(~v)" debug-name pid) + (define result enclosed-expr) + (matrix-log 'debug "Leaving process ~v(~v)" debug-name pid) + result)) (: action-tree->quasiqueue : (All (State) (ActionTree State) -> (QuasiQueue (Action State)))) (define (action-tree->quasiqueue t) diff --git a/marketplace/roles.rkt b/marketplace/roles.rkt index 7ac1afb..67fdc36 100644 --- a/marketplace/roles.rkt +++ b/marketplace/roles.rkt @@ -2,6 +2,7 @@ (require racket/match) (require "types.rkt") +(require "log-typed.rkt") (require/typed "unify.rkt" [wild (case-> (-> Topic) (Symbol -> Topic))] [mgu-canonical (Topic Topic -> Topic)] @@ -46,8 +47,11 @@ ;; "Both left and right must be canonicalized." - comment from os2.rkt. What does it mean? (: role-intersection : Role Role -> (Option Topic)) (define (role-intersection left right) - (and (orientations-intersect? (role-orientation left) (role-orientation right)) - (mgu-canonical (freshen (role-topic left)) (freshen (role-topic right))))) + (define result + (and (orientations-intersect? (role-orientation left) (role-orientation right)) + (mgu-canonical (freshen (role-topic left)) (freshen (role-topic right))))) + (matrix-log 'debug "role-intersection ~v // ~v --> ~v" left right result) + result) ;; True iff the flow between remote-role and local-role should be ;; visible to the local peer. This is the case when either local-role