logger/service/model.go

48 lines
1.1 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package service
import (
"log"
"github.com/fatih/color"
)
type (
Config struct {
System string // Название сервиса
Development bool // Режим разработки
Directory string // Папка в которую необходимо сохранять логи
LogFileName string // Файл логов
PanicFileName string // Файл ошибок с паникой
Webhook string // Url для отправки вебхука
}
LoggerService struct {
Log *log.Logger
ServiceName string
WebhookUrl string
Development bool
}
LogStruct struct {
Message string
Color color.Attribute
}
LogErrorStruct struct {
System string `json:"system"`
Message string `json:"message"`
Error TypeError `json:"error"`
}
TypeError struct {
Code int `json:"code"`
Description string `json:"description"`
}
)
// var (
// MarshalError = TypeError{Code: 1, Description: "Ошибка маршала"}
// ServiceError = TypeError{Code: 2, Description: "Сервисная ошибка"}
// CacheError = TypeError{Code: 3, Description: "Ошибка badger"}
// )