Browse Source

restore logLevel: debug

pull/666/head v0.17.6
aler9 5 years ago
parent
commit
b21efeb28f
  1. 6
      internal/conf/conf_test.go
  2. 2
      internal/logger/logger.go

6
internal/conf/conf_test.go

@ -11,6 +11,8 @@ import ( @@ -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) { @@ -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) { @@ -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{

2
internal/logger/logger.go

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

Loading…
Cancel
Save