Добавление логирования в файл

This commit is contained in:
2025-09-25 20:24:33 +03:00
parent d6fe11c8e3
commit b826188019
5 changed files with 239 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ type Config struct {
ReposBaseDir string `toml:"reposBaseDir" env:"REPOS_BASE_DIR"`
Repositories map[string]GitRepo `toml:"repositories"`
Webhook Webhook `toml:"webhook" envPrefix:"WEBHOOK_"`
Logging Logging `toml:"logging" envPrefix:"LOGGING_"`
}
type GitRepo struct {
@@ -43,3 +44,9 @@ type Commit struct {
type Webhook struct {
PasswordHash string `toml:"pwd_hash" env:"PASSWORD_HASH"`
}
type Logging struct {
LogFile string `toml:"log_file" env:"LOG_FILE"`
MaxSize int64 `toml:"max_size" env:"MAX_SIZE"`
EnableFile bool `toml:"enable_file" env:"ENABLE_FILE"`
}