refactor logger #2
Reference in New Issue
Block a user
Delete Branch "log"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
major changes:
use
github.com/rs/zerologas loggermisc
log templateandmult errorpackagesignals.goutils.AnyContains, it needs to be split into different typesutils.PanicCatcheralso usezerologand with stack traceutilspackage add someGet...Dictforzerologdatabase
SaveDatabaseandReadDatabasefuncRecordDatato count usage in single funcmain
.envfile and environmentadd `SaveDatabase` and `ReadDatabase` database operate function import `github.com/rs/zerolog` use as logger move most config into yaml config file use `filepath.Join()` to combine file path separate some function from `utils` move signal channel to `signals` package make exit code in `SignalsHandler()` change debug script output directory to `${workspaceFolder}/__debug_bin`refactor loggerto WIP: refactor loggerhandlers.go: fix wrong var utils/yaml/yaml.go remove fmt package plugins/teamspeak: allow check online client failed 5 times before reinit all and other: use err template plugin use yaml.Load() and yaml.Save() manage databases use mult error to recored all errorplugin_sticker: add sticker collect to channel feature allow detected `addsticker` link and show download sticker set button database: remove `IsInitialized` and `InitializedErr` in `DatabaseBackend` struct add `context.Context` params in `DatabaseBackend.Initializer` yaml_db: using `yaml.LoadYAML()` and `yaml.SaveYAML()` to save database file using `zerolog` logger replace `log` fix database file protection logic remove `addToYamlDB()` func update `Database.UpdateTimestamp` when change some flag handlers: fix `CustomSymbolCommand` trigger: use `strings.HasPrefix()` to replace `utils.CommandMaybeWithSuffixUsername()`, custom symbol command will not include robot username suffix consts: rename `YAMLDataBasePath` to `YAMLDataBaseDir` mess: remove `PrintLogAndSave()` funcWIP: refactor loggerto refactor logger