From b04b3062e94c95578c4ec0436d86c9803b86b3f2 Mon Sep 17 00:00:00 2001 From: Ebus-at-dockstar Date: Sat, 26 Jul 2014 20:34:34 +0200 Subject: changed logging --- ebus-racket/ebus/layer2.rkt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'ebus-racket/ebus/layer2.rkt') 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))) -- cgit v1.2.1