2023-08-04 11:26:40 +00:00
|
|
|
package logs //declaration package
|
|
|
|
|
|
|
|
/*After upgrading to golangci-lint version 1.5.4 and adding linter configuration, it will be possible to get rid of 'magic repositories'*/
|
2023-07-18 08:16:27 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2023-08-04 11:26:40 +00:00
|
|
|
tochno_ne_const_dly_log "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"// The alias of the package with constants differs from the one used
|
2023-07-18 08:16:27 +00:00
|
|
|
)
|
|
|
|
|
2023-07-31 09:59:51 +00:00
|
|
|
func (c *cfg) info_ok() {
|
2023-08-04 11:26:40 +00:00
|
|
|
c.log.Info(tochno_ne_const_dly_log.MSG)
|
2023-07-31 09:59:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *cfg) debug_ok() {
|
2023-08-04 11:26:40 +00:00
|
|
|
c.log.Debug(tochno_ne_const_dly_log.MSG)
|
2023-07-18 08:16:27 +00:00
|
|
|
}
|
|
|
|
|
2023-07-31 09:59:51 +00:00
|
|
|
func (c *cfg) error_ok() {
|
2023-08-04 11:26:40 +00:00
|
|
|
c.log.Error(tochno_ne_const_dly_log.MSG)
|
2023-07-31 09:59:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *cfg) custom_ok_const() {
|
2023-08-04 11:26:40 +00:00
|
|
|
c.log.Abyr(tochno_ne_const_dly_log.MSG)
|
2023-07-31 09:59:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-07-18 08:16:27 +00:00
|
|
|
type Logger interface {
|
|
|
|
Debug(msg string)
|
|
|
|
Info(msg string)
|
|
|
|
Warn(msg string)
|
|
|
|
Error(msg string)
|
|
|
|
Abyr(msg string)
|
|
|
|
}
|
|
|
|
|
|
|
|
type RealLogger struct{}
|
|
|
|
|
|
|
|
func (l RealLogger) Debug(msg string) {
|
|
|
|
}
|
|
|
|
func (l RealLogger) Info(msg string) {
|
|
|
|
}
|
|
|
|
func (l RealLogger) Warn(msg string) {
|
|
|
|
}
|
|
|
|
func (l RealLogger) Error(msg string) {
|
|
|
|
}
|
|
|
|
func (l RealLogger) Abyr(msg string) {
|
|
|
|
}
|
|
|
|
|
|
|
|
type RealLogger struct{}
|
|
|
|
|
|
|
|
func (l RealLogger) Info(msg string) {
|
|
|
|
fmt.Println(msg)
|
|
|
|
}
|
|
|
|
|
|
|
|
var logs = struct {
|
|
|
|
MSG string
|
|
|
|
}{
|
|
|
|
MSG: "some message",
|
|
|
|
}
|
|
|
|
|
|
|
|
type cfg struct {
|
|
|
|
log Logger
|
|
|
|
}
|