mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
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"}
20 lines
450 B
Go
20 lines
450 B
Go
package log
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestLog(t *testing.T) {
|
|
// Init("error", []string{"stdout", "test.log"})
|
|
|
|
Info("Test log.Info", " value is ", 10)
|
|
Infof("Test log.Infof %d", 10)
|
|
Infow("Test log.Infow", "value", 10)
|
|
Debugf("Test log.Debugf %d", 10)
|
|
Error("Test log.Error", " value is ", 10)
|
|
Errorf("Test log.Errorf %d", 10)
|
|
Errorw("Test log.Errorw", "value", 10)
|
|
Warnf("Test log.Warnf %d", 10)
|
|
Warnw("Test log.Warnw", "value", 10)
|
|
}
|