summaryrefslogtreecommitdiff
path: root/ebus-racket/ebus/layer7.rkt
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2014-07-26 20:15:03 +0200
committerYves Fischer <yvesf-git@xapek.org>2014-07-26 20:15:03 +0200
commit99c6eb21eb7ff9a072b87d9d64324871ea7201f1 (patch)
treea10f6469ce898d518955ee85cf367c8a2af77b29 /ebus-racket/ebus/layer7.rkt
parent773093acabfb84b88c37bb0342d6a8d4a6f8267a (diff)
downloadebus-alt-99c6eb21eb7ff9a072b87d9d64324871ea7201f1.tar.gz
ebus-alt-99c6eb21eb7ff9a072b87d9d64324871ea7201f1.zip
fix logging, re-enable dumper layer7 output
Diffstat (limited to 'ebus-racket/ebus/layer7.rkt')
-rw-r--r--ebus-racket/ebus/layer7.rkt10
1 files changed, 7 insertions, 3 deletions
diff --git a/ebus-racket/ebus/layer7.rkt b/ebus-racket/ebus/layer7.rkt
index c7fb228..60f8bbc 100644
--- a/ebus-racket/ebus/layer7.rkt
+++ b/ebus-racket/ebus/layer7.rkt
@@ -7,6 +7,7 @@
"layer2.rkt")
(define logger (make-logger 'ebus-layer7 (current-logger)))
+(current-logger logger)
(define definition
(parameterize ([collapse-whitespace #t]
@@ -16,6 +17,7 @@
(define (paket ebus-paket)
(define primaryCommand (number->string (layer2-ebus-paket-primaryCommand ebus-paket)))
(define secondaryCommand (number->string (layer2-ebus-paket-secondaryCommand ebus-paket)))
+ (log-debug "Lookup paket primaryCommand=~a secondaryCommand=~a" primaryCommand secondaryCommand)
(xexpr-path-first (list 'packets 'packet (list 'primary primaryCommand)
(list 'secondary secondaryCommand)) definition))
@@ -44,8 +46,10 @@
(define payload (layer2-ebus-paket-payload ebus-paket))
(for/list ([decoder decoders])
(decoder payload)))
- (else (void (log-message logger 'warning
- (format "Unknown Paket from source ~s: ~s" (layer2-ebus-paket-source ebus-paket) ebus-paket) #t)))))
+ (else (void (log-info "Unknown Paket from source ~s(~s): ~s"
+ (layer2-ebus-paket-source ebus-paket)
+ source-device-name
+ ebus-paket)))))
(define (create-decoder paket-id field)
@@ -53,7 +57,7 @@
(define name (string-append paket-id "." (xexpr-path-first '((name)) field)))
(define offset (string->number (xexpr-path-first '((offset)) field)))
(define decoder (hash-ref decoder-table type #f))
- (cond ((false? decoder) (void (log-message logger 'warning (format "No decoder for type ~s" type) #t)))
+ (cond ((false? decoder) (void (log-warning "No decoder for type ~s" type)))
(else (curry (car decoder) name field offset))))
(define decoder-table