package log

import (
	"fmt"
	"strconv"
	"time"

	"git.insit.tech/psa/rtsp_reader-writer/reader/internal/config"
	log2 "git.insit.tech/sas/rtsp_proxy/core/log"
	"go.uber.org/zap"
)

var (
	Log *zap.Logger
)

// StartMainLogger establishes main logger.
func StartMainLogger(local, program string) {
	config.LogsDirectory = log2.DirCreator(local, "logs")
	Log = log2.MainLogging(
		fmt.Sprintf("%s/%s-main_%s.log",
			config.LogsDirectory,
			program,
			strconv.FormatInt(time.Now().Unix(), 10)))
}
