restore logLevel: debug

This commit is contained in:
aler9 2021-10-05 20:36:15 +02:00
parent 0d4d81c333
commit b21efeb28f
2 changed files with 8 additions and 4 deletions

View File

@ -11,6 +11,8 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/crypto/nacl/secretbox"
"github.com/aler9/rtsp-simple-server/internal/logger"
)
func writeTempFile(byts []byte) (string, error) {
@ -30,7 +32,7 @@ func writeTempFile(byts []byte) (string, error) {
func TestConfFromFile(t *testing.T) {
func() {
tmpf, err := writeTempFile([]byte(
tmpf, err := writeTempFile([]byte("logLevel: debug\n" +
"paths:\n" +
" cam1:\n" +
" runOnDemandStartTimeout: 5s\n"))
@ -41,6 +43,8 @@ func TestConfFromFile(t *testing.T) {
require.NoError(t, err)
require.Equal(t, true, hasFile)
require.Equal(t, LogLevel(logger.Debug), conf.LogLevel)
pa, ok := conf.Paths["cam1"]
require.Equal(t, true, ok)
require.Equal(t, &PathConf{

View File

@ -16,7 +16,7 @@ type Level int
// Log levels.
const (
Debug Level = iota
Debug Level = iota + 1
Info
Warn
)