Improve logging

This commit is contained in:
Andrew-71 2024-10-23 11:26:35 +03:00
parent 57903d4724
commit ca9b6e05b7
10 changed files with 49 additions and 21 deletions

View file

@ -1,12 +1,22 @@
package config
type AppInfo struct {
Version string
SourceLink string
version string
source string
}
// Info contains app information.
var Info = AppInfo{
Version: "2.0.0",
SourceLink: "https://git.a71.su/Andrew71/hibiscus",
version: "2.0.0",
source: "https://git.a71.su/Andrew71/hibiscus",
}
// Version returns the current app version
func (i AppInfo) Version() string {
return i.version
}
// Source returns app's git repository
func (i AppInfo) Source() string {
return i.source
}

View file

@ -29,7 +29,7 @@ type Config struct {
Theme string `config:"theme" type:"string"`
Title string `config:"title" type:"string"`
LogToFile bool `config:"log_to_file" type:"bool"`
LogFile string `config:"log_file" type:"string"`
LogDir string `config:"log_dir" type:"string"`
Scram bool `config:"enable_scram" type:"bool"`
TelegramToken string `config:"tg_token" type:"string"`
@ -47,7 +47,7 @@ var DefaultConfig = Config{
Theme: "",
Title: "🌺 Hibiscus.txt",
LogToFile: false,
LogFile: "config/log.txt",
LogDir: "logs",
Scram: false,
TelegramToken: "",