Add opt to disable print logs but storing to file

By default outputs contains "stdout", which prints the logs at the
output of the process. To add a log file as output, the path should be
added at the outputs array. To avoid printing the logs but storing them
on a file, can use []string{"pathtofile.log"}
This commit is contained in:
arnaucube
2021-01-12 18:32:36 +01:00
parent a5643c16f6
commit dffc7e2f4e
2 changed files with 9 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ import (
)
func TestLog(t *testing.T) {
// Init("debug", "test.log")
// Init("error", []string{"stdout", "test.log"})
Info("Test log.Info", " value is ", 10)
Infof("Test log.Infof %d", 10)