package example

import (
	"fmt"

	"github.com/pingcap/log"
	"go.uber.org/zap"
)

func LogPrint() {
	a := 1
	path := "path variable"
	log.Info(
		fmt.Sprintf("sprint %d", a))
	log.L().Info(path,
		zap.Error(nil))
	log.Error(
		"test error")

	log.Info(fmt.Sprintf("%s is set as data-dir (%dGB available), sort-dir=%s. "+
		"It is recommended that the disk for data-dir at least have %dGB available space", "xxx", 123, "xxx", 123))

	logReq := log.Debug
	if a == 1 {
		logReq = log.Error
	}
	logReq(
		"start new request")

	logPrint1(path)
}

func logPrint1(path string) {
	defer log.Info(
		"hahaha")
	log.Info(
		"the capture routine has exited")
	defer func() {}()
	log.Info(path, zap.Int("status", 123))

	return
}
