From f0c036c686b3d52bc9311e957cf78a6bbd3363c9 Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Wed, 7 Jun 2023 15:56:31 +0200 Subject: [PATCH] fix: log message levels in examples Signed-off-by: Christopher Arndt --- examples/jacket_midi_print.nim | 4 ++-- examples/jacket_midi_print_ringbuffer.nim | 8 ++------ examples/jacket_midi_print_thread.nim | 4 ++-- examples/jacket_midi_print_threading.nim | 4 ++-- examples/jacket_port_connect_cb.nim | 4 ++-- examples/jacket_port_register.nim | 4 ++-- examples/jacket_sine.nim | 4 ++-- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/examples/jacket_midi_print.nim b/examples/jacket_midi_print.nim index ab23561..5568105 100644 --- a/examples/jacket_midi_print.nim +++ b/examples/jacket_midi_print.nim @@ -23,11 +23,11 @@ proc errorCb(msg: cstring) {.cdecl.} = debug "JACK error: " & $msg proc signalCb(sig: cint) {.noconv.} = - info "Received signal: " & $sig + debug "Received signal: " & $sig exitSignalled = true proc shutdownCb(arg: pointer = nil) {.cdecl.} = - info "JACK server has shut down." + warn "JACK server has shut down." exitSignalled = true proc printMidiEvent(event: var MidiEvent) = diff --git a/examples/jacket_midi_print_ringbuffer.nim b/examples/jacket_midi_print_ringbuffer.nim index bd0d6d5..087e202 100644 --- a/examples/jacket_midi_print_ringbuffer.nim +++ b/examples/jacket_midi_print_ringbuffer.nim @@ -22,7 +22,6 @@ let rbSize = 128 var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug) addHandler(log) - proc cleanup() = debug "Cleaning up..." @@ -55,11 +54,11 @@ proc errorCb(msg: cstring) {.cdecl.} = debug "JACK error: " & $msg proc signalCb(sig: cint) {.noconv.} = - info "Received signal: " & $sig + debug "Received signal: " & $sig exitSignalled = true proc shutdownCb(arg: pointer = nil) {.cdecl.} = - info "JACK server has shut down." + warn "JACK server has shut down." exitSignalled = true proc midiEventPrinterProc() {.thread.} = @@ -85,7 +84,6 @@ proc midiEventPrinterProc() {.thread.} = dataReadyLock.release() - proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} = var msgBuf: array[4, uint8] @@ -109,7 +107,6 @@ proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} = dataReady.signal() dataReadyLock.release() - proc main() = # Create JACK client setErrorFunction(errorCb) @@ -154,6 +151,5 @@ proc main() = debug "Freeing ringbuffer memory." ringbufferFree(rb) - when isMainModule: main() diff --git a/examples/jacket_midi_print_thread.nim b/examples/jacket_midi_print_thread.nim index f77d3b2..2e4e0ea 100644 --- a/examples/jacket_midi_print_thread.nim +++ b/examples/jacket_midi_print_thread.nim @@ -46,11 +46,11 @@ proc errorCb(msg: cstring) {.cdecl.} = debug "JACK error: " & $msg proc signalCb(sig: cint) {.noconv.} = - info "Received signal: " & $sig + debug "Received signal: " & $sig exitSignalled = true proc shutdownCb(arg: pointer = nil) {.cdecl.} = - info "JACK server has shut down." + warn "JACK server has shut down." exitSignalled = true proc midiEventPrinterProc() = diff --git a/examples/jacket_midi_print_threading.nim b/examples/jacket_midi_print_threading.nim index 24270e0..6cad156 100644 --- a/examples/jacket_midi_print_threading.nim +++ b/examples/jacket_midi_print_threading.nim @@ -50,11 +50,11 @@ proc errorCb(msg: cstring) {.cdecl.} = debug "JACK error: " & $msg proc signalCb(sig: cint) {.noconv.} = - info "Received signal: " & $sig + debug "Received signal: " & $sig exitSignalled = true proc shutdownCb(arg: pointer = nil) {.cdecl.} = - info "JACK server has shut down." + warn "JACK server has shut down." exitSignalled = true proc midiEventPrinterProc() = diff --git a/examples/jacket_port_connect_cb.nim b/examples/jacket_port_connect_cb.nim index 2104a74..f52f22a 100644 --- a/examples/jacket_port_connect_cb.nim +++ b/examples/jacket_port_connect_cb.nim @@ -20,11 +20,11 @@ proc errorCb(msg: cstring) {.cdecl.} = debug "JACK error: " & $msg proc signalCb(sig: cint) {.noconv.} = - info "Received signal: " & $sig + debug "Received signal: " & $sig exitSignalled = true proc shutdownCb(arg: pointer = nil) {.cdecl.} = - info "JACK server has shut down." + warn "JACK server has shut down." exitSignalled = true proc portConnected(portA: PortId; portB: PortId; connect: cint; arg: pointer) {.cdecl.} = diff --git a/examples/jacket_port_register.nim b/examples/jacket_port_register.nim index 7e3f989..e039d06 100644 --- a/examples/jacket_port_register.nim +++ b/examples/jacket_port_register.nim @@ -19,11 +19,11 @@ proc errorCb(msg: cstring) {.cdecl.} = debug "JACK error: " & $msg proc signalCb(sig: cint) {.noconv.} = - info "Received signal: " & $sig + debug "Received signal: " & $sig exitSignalled = true proc shutdownCb(arg: pointer = nil) {.cdecl.} = - info "JACK server has shut down." + warn "JACK server has shut down." exitSignalled = true addHandler(log) diff --git a/examples/jacket_sine.nim b/examples/jacket_sine.nim index 9cfa9d6..7ee77fa 100644 --- a/examples/jacket_sine.nim +++ b/examples/jacket_sine.nim @@ -54,11 +54,11 @@ proc errorCb(msg: cstring) {.cdecl.} = debug "JACK error: " & $msg proc signalCb(sig: cint) {.noconv.} = - info "Received signal: " & $sig + debug "Received signal: " & $sig exitSignalled = true proc shutdownCb(arg: pointer = nil) {.cdecl.} = - info "JACK server has shut down." + warn "JACK server has shut down." exitSignalled = true proc processCb(nFrames: NFrames, arg: pointer): cint {.cdecl.} =