package log

import (
	"fmt"
	"os"
	"path/filepath"
	"testing"
	"time"

	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)

func TestSLogger(t *testing.T) {
	file := "./p.log"
	d := filepath.Dir(file)
	_ = os.MkdirAll(d, 0755)

	logger := NewSLogger(true, file, zapcore.DebugLevel)
	logger.Debug("good", zap.String("name", "jiansui"), zap.Duration("lasts", 3*time.Second))
	logger.Info("2fdfsdf", zap.String("ts", "jiansui"), zap.Duration("lasts", 3*time.Second))
	logger.Warn("345345", zap.String("lvl", "jiansui"), zap.Duration("lasts", 3*time.Second))
	logger.Error("erer", zap.String("hello", "jiansui"), zap.Duration("lasts", 3*time.Second))
	fmt.Println("-----------")
}
