package service

import (
	"git.markbailey.dev/cervers/ptpp/lib/logger"
	"sync"
)

var (
	log   interface{}
	llock = &sync.Mutex{}
)

type SLogger struct{}

func NewSLogger() *SLogger {
	return &SLogger{}
}

func (s *SLogger) Name() string {
	return "logger"
}

func (s *SLogger) Use() interface{} {
	if log == nil {
		llock.Lock()
		defer llock.Unlock()

		log = logger.NewCompositeLogger()
	}

	return log
}
