Skip to content

Strip newline from log output of exec()

ratijas requested to merge ratijas/midi2input:strip-exec-log into master

Now it does this:

[2020-10-06 00:18:09.297] [info] SCRIPT: Before:
[2020-10-06 00:18:09.297] [info] LUA: exec: aconnect -l
[2020-10-06 00:18:09.301] [info] LUA: client 0: 'System' [type=kernel]
[2020-10-06 00:18:09.301] [info] LUA:     0 'Timer           '
[2020-10-06 00:18:09.301] [info] LUA:     1 'Announce        '
[2020-10-06 00:18:09.301] [info] LUA: client 14: 'Midi Through' [type=kernel]
[2020-10-06 00:18:09.301] [info] LUA:     0 'Midi Through Port-0'
[2020-10-06 00:18:09.301] [info] LUA: client 24: 'V49' [type=kernel,card=2]
[2020-10-06 00:18:09.301] [info] LUA:     0 'V49 MIDI 1      '
[2020-10-06 00:18:09.301] [info] LUA:     1 'V49 MIDI 2      '
[2020-10-06 00:18:09.301] [info] LUA: client 128: 'midi2input_alsa' [type=user,pid=123327]
[2020-10-06 00:18:09.301] [info] LUA:     0 'in              '
[2020-10-06 00:18:09.301] [info] LUA:     1 'out             '
[2020-10-06 00:18:09.301] [info] LUA: exec: 
        aconnect midi2input_alsa:1 V49:0 ; 
        aconnect V49:0 midi2input_alsa:0 ; 
[2020-10-06 00:18:09.307] [info] SCRIPT: After:
[2020-10-06 00:18:09.307] [info] LUA: exec: aconnect -l
[2020-10-06 00:18:09.310] [info] LUA: client 0: 'System' [type=kernel]
[2020-10-06 00:18:09.310] [info] LUA:     0 'Timer           '
[2020-10-06 00:18:09.310] [info] LUA:     1 'Announce        '
[2020-10-06 00:18:09.310] [info] LUA: client 14: 'Midi Through' [type=kernel]
[2020-10-06 00:18:09.310] [info] LUA:     0 'Midi Through Port-0'
[2020-10-06 00:18:09.310] [info] LUA: client 24: 'V49' [type=kernel,card=2]
[2020-10-06 00:18:09.310] [info] LUA:     0 'V49 MIDI 1      '
[2020-10-06 00:18:09.310] [info] LUA:   Connecting To: 128:0
[2020-10-06 00:18:09.310] [info] LUA:   Connected From: 128:1
[2020-10-06 00:18:09.310] [info] LUA:     1 'V49 MIDI 2      '
[2020-10-06 00:18:09.311] [info] LUA: client 128: 'midi2input_alsa' [type=user,pid=123327]
[2020-10-06 00:18:09.311] [info] LUA:     0 'in              '
[2020-10-06 00:18:09.311] [info] LUA:   Connected From: 24:0
[2020-10-06 00:18:09.311] [info] LUA:     1 'out             '
[2020-10-06 00:18:09.311] [info] LUA:   Connecting To: 24:0

... instead of this:

[2020-10-05 22:59:56.089] [info] SCRIPT: Before:
[2020-10-05 22:59:56.089] [info] LUA: exec: aconnect -l
[2020-10-05 22:59:56.094] [info] LUA: client 0: 'System' [type=kernel]

[2020-10-05 22:59:56.094] [info] LUA:     0 'Timer           '

[2020-10-05 22:59:56.094] [info] LUA:     1 'Announce        '

[2020-10-05 22:59:56.094] [info] LUA: client 14: 'Midi Through' [type=kernel]

[2020-10-05 22:59:56.094] [info] LUA:     0 'Midi Through Port-0'

[2020-10-05 22:59:56.094] [info] LUA: client 128: 'midi2input_alsa' [type=user,pid=89512]

[2020-10-05 22:59:56.094] [info] LUA:     0 'in              '

[2020-10-05 22:59:56.094] [info] LUA:     1 'out             '

[2020-10-05 22:59:56.094] [info] LUA: exec: 
        aconnect 'midi2input_alsa':1 'V49':0 ; 
        aconnect 'V49':0 'midi2input_alsa':0 ; 
    
invalid destination address V49:0
invalid sender address V49:0
[2020-10-05 22:59:56.103] [info] SCRIPT: After:
[2020-10-05 22:59:56.103] [info] LUA: exec: aconnect -l
[2020-10-05 22:59:56.109] [info] LUA: client 0: 'System' [type=kernel]

[2020-10-05 22:59:56.109] [info] LUA:     0 'Timer           '

[2020-10-05 22:59:56.109] [info] LUA:     1 'Announce        '

[2020-10-05 22:59:56.109] [info] LUA: client 14: 'Midi Through' [type=kernel]

[2020-10-05 22:59:56.109] [info] LUA:     0 'Midi Through Port-0'

[2020-10-05 22:59:56.109] [info] LUA: client 128: 'midi2input_alsa' [type=user,pid=89512]

[2020-10-05 22:59:56.109] [info] LUA:     0 'in              '

[2020-10-05 22:59:56.109] [info] LUA:     1 'out             '

Merge request reports