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

View File

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