diff options
Diffstat (limited to 'ebus-racket/ebus/layer2.rkt')
-rw-r--r-- | ebus-racket/ebus/layer2.rkt | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ebus-racket/ebus/layer2.rkt b/ebus-racket/ebus/layer2.rkt index 192f7f5..3141452 100644 --- a/ebus-racket/ebus/layer2.rkt +++ b/ebus-racket/ebus/layer2.rkt @@ -2,8 +2,7 @@ (require racket/bool (planet bzlib/parseq:1:3)) -(define logger (make-logger 'ebus-layer2 (current-logger))) -(current-logger logger) +(define-logger ebus2) ;; Ebus SYN (define ebus-const-syn #xaa) @@ -84,16 +83,13 @@ (define (read-ebus input-port) (define syn ((make-reader ebus-sync #:sof? #f #:eof? #f) input-port)) (define paket ((make-reader parse-ebus-paket #:sof? #f #:eof? #f) input-port)) - (cond ((not (false? syn)) - (log-debug "drop ~s x SYN (~s)" syn ebus-const-syn))) - (cond ((not (false? paket)) - paket) - ((eof-object? (peek-byte input-port)) - eof) + (cond ((not (false? syn)) (log-ebus2-debug "dropped ~a x SYN (~a)" syn ebus-const-syn))) + (cond ((not (false? paket)) paket) + ((eof-object? (peek-byte input-port)) eof) (else ;; skip one byte (let ([byte (read-byte input-port)]) - (log-debug "drop ~s 0x~x" byte byte)) + (log-ebus2-debug "drop ~s 0x~x" byte byte)) (read-ebus input-port)))) (provide @@ -102,5 +98,4 @@ (prefix-out layer2- (struct-out ebus-paket)) (prefix-out layer2- (struct-out ebus-body-broadcast)) (prefix-out layer2- (struct-out ebus-body-mastermaster)) - (prefix-out layer2- (struct-out ebus-body-masterslave)) - (prefix-out layer2- logger)) + (prefix-out layer2- (struct-out ebus-body-masterslave))) |