mirror of https://github.com/dtm-labs/dtm.git
csharpjavadistributed-transactionsdtmgogolangmicroservicenodejsphpdatabasesagaseatatcctransactiontransactionsxapythondistributed
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
509 B
29 lines
509 B
package logger
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestInitLog(t *testing.T) {
|
|
os.Setenv("DTM_DEBUG", "1")
|
|
InitLog("debug")
|
|
Debugf("a debug msg")
|
|
Infof("a info msg")
|
|
Warnf("a warn msg")
|
|
Errorf("a error msg")
|
|
FatalfIf(false, "nothing")
|
|
FatalIfError(nil)
|
|
}
|
|
|
|
func TestWithLogger(t *testing.T) {
|
|
logger := logrus.New()
|
|
WithLogger(logger)
|
|
Debugf("a debug msg")
|
|
Infof("a info msg")
|
|
Warnf("a warn msg")
|
|
Errorf("a error msg")
|
|
FatalfIf(false, "nothing")
|
|
FatalIfError(nil)
|
|
}
|