Skip to content

Commit

Permalink
restore logLevel: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Oct 5, 2021
1 parent 0d4d81c commit b21efeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions internal/conf/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -30,17 +32,19 @@ 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"))
" cam1:\n" +
" runOnDemandStartTimeout: 5s\n"))
require.NoError(t, err)
defer os.Remove(tmpf)

conf, hasFile, err := Load(tmpf)
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{
Expand Down
2 changes: 1 addition & 1 deletion internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Level int

// Log levels.
const (
Debug Level = iota
Debug Level = iota + 1
Info
Warn
)
Expand Down

0 comments on commit b21efeb

Please sign in to comment.