fix: log message levels in examples

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
Christopher Arndt 2023-06-07 15:56:31 +02:00
parent aadbd26fab
commit f0c036c686
7 changed files with 14 additions and 18 deletions

View File

@ -23,11 +23,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
info "Received signal: " & $sig debug "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
info "JACK server has shut down." warn "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc printMidiEvent(event: var MidiEvent) = proc printMidiEvent(event: var MidiEvent) =

View File

@ -22,7 +22,6 @@ let rbSize = 128
var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug) var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug)
addHandler(log) addHandler(log)
proc cleanup() = proc cleanup() =
debug "Cleaning up..." debug "Cleaning up..."
@ -55,11 +54,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
info "Received signal: " & $sig debug "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
info "JACK server has shut down." warn "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc midiEventPrinterProc() {.thread.} = proc midiEventPrinterProc() {.thread.} =
@ -85,7 +84,6 @@ proc midiEventPrinterProc() {.thread.} =
dataReadyLock.release() dataReadyLock.release()
proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} = proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} =
var msgBuf: array[4, uint8] var msgBuf: array[4, uint8]
@ -109,7 +107,6 @@ proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} =
dataReady.signal() dataReady.signal()
dataReadyLock.release() dataReadyLock.release()
proc main() = proc main() =
# Create JACK client # Create JACK client
setErrorFunction(errorCb) setErrorFunction(errorCb)
@ -154,6 +151,5 @@ proc main() =
debug "Freeing ringbuffer memory." debug "Freeing ringbuffer memory."
ringbufferFree(rb) ringbufferFree(rb)
when isMainModule: when isMainModule:
main() main()

View File

@ -46,11 +46,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
info "Received signal: " & $sig debug "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
info "JACK server has shut down." warn "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc midiEventPrinterProc() = proc midiEventPrinterProc() =

View File

@ -50,11 +50,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
info "Received signal: " & $sig debug "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
info "JACK server has shut down." warn "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc midiEventPrinterProc() = proc midiEventPrinterProc() =

View File

@ -20,11 +20,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
info "Received signal: " & $sig debug "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
info "JACK server has shut down." warn "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc portConnected(portA: PortId; portB: PortId; connect: cint; arg: pointer) {.cdecl.} = proc portConnected(portA: PortId; portB: PortId; connect: cint; arg: pointer) {.cdecl.} =

View File

@ -19,11 +19,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
info "Received signal: " & $sig debug "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
info "JACK server has shut down." warn "JACK server has shut down."
exitSignalled = true exitSignalled = true
addHandler(log) addHandler(log)

View File

@ -54,11 +54,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
info "Received signal: " & $sig debug "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
info "JACK server has shut down." warn "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc processCb(nFrames: NFrames, arg: pointer): cint {.cdecl.} = proc processCb(nFrames: NFrames, arg: pointer): cint {.cdecl.} =