# Logs messages as JSON when log.format=json is passed

exec bash -x ./test.sh &
exec karma --log.format=json --log.timestamp=false --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8058
! stdout .
cmp stderr stderr.txt
wait

-- stderr.txt --
{"level":"INFO","msg":"Version: dev"}
{"level":"INFO","msg":"Writing PID file","path":"karma.pid"}
{"level":"INFO","msg":"Initial Alertmanager collection"}
{"level":"INFO","msg":"Pulling latest alerts and silences from Alertmanager"}
{"level":"INFO","msg":"Collection completed"}
{"level":"INFO","msg":"Done, starting HTTP server"}
{"level":"INFO","msg":"Starting HTTP server","address":"127.0.0.1:8058"}
{"level":"INFO","msg":"Shutting down HTTP server","signal":15}
{"level":"INFO","msg":"HTTP server shut down"}
{"level":"INFO","msg":"Removing PID file","path":"karma.pid"}
-- test.sh --
while [ ! -f karma.pid ]; do sleep 1 ; done
sleep 5
cat karma.pid | xargs kill
