Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/pkg/logcli/output/output_test.go

28 lines
646 B

package output
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestNewLogOutput(t *testing.T) {
options := &LogOutputOptions{time.UTC, false, false}
out, err := NewLogOutput(nil, "default", options)
assert.NoError(t, err)
assert.IsType(t, &DefaultOutput{nil, options}, out)
out, err = NewLogOutput(nil, "jsonl", options)
assert.NoError(t, err)
assert.IsType(t, &JSONLOutput{nil, options}, out)
out, err = NewLogOutput(nil, "raw", options)
assert.NoError(t, err)
assert.IsType(t, &RawOutput{nil, options}, out)
out, err = NewLogOutput(nil, "unknown", options)
assert.Error(t, err)
assert.Nil(t, out)
}