Skip to content

Commit

Permalink
path fix
Browse files Browse the repository at this point in the history
patch->path
  • Loading branch information
NuclearAPK committed Jul 2, 2023
1 parent 7b2d0a5 commit 5e24656
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions conf/settings.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Расположение логов тех журнала 1С
patch: "D:\\temp\\1C_log"
path: "D:\\temp\\1C_log"
# Удалять табуляции в контекстных строках
delete_tabs_in_contexts: true
# Заменять постфиксы виртуальных таблиц в контекстах, например #tt36 на #tt
Expand Down Expand Up @@ -36,7 +36,7 @@ elastic_indx: "tech_journal_{event}_yyyyMMddhh"
tech_log_details_events: "Context|Txt|Descr|DeadlockConnectionIntersections|ManagerList|ServerList|Sql|Sdbl|Eds|URI|Headers"
#
# Путь, где будут распологаться логи программы
patch_logfile: "D:\\Temp\\fucklogs\\"
path_logfile: "D:\\Temp\\fucklogs\\"
#
# Глубина фиксации ошибок при работе программы:
# 1 - только ошибки
Expand Down
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

// =======================================================================================
type conf struct {
Patch string `yaml:"patch"`
Path string `yaml:"path"`
RedisAddr string `yaml:"redis_addr"`
RedisLogin string `yaml:"redis_login"`
RedisPassword string `yaml:"redis_password"`
Expand All @@ -47,7 +47,7 @@ type conf struct {
TechLogDetailsEvents string `yaml:"tech_log_details_events"`
MaxDop int `yaml:"maxdop"`
Sorting int `yaml:"sorting"`
PatchLogFile string `yaml:"patch_logfile"`
PathLogFile string `yaml:"path_logfile"`
LogLevel int `yaml:"log_level"`
LogLifeSpan int `yaml:"log_life_span"`
DeleteTabsInContexts bool `yaml:"delete_tabs_in_contexts"`
Expand Down Expand Up @@ -617,11 +617,11 @@ func jobExtractTechLogs(filesInPackage []files, keyInPackage int, config *conf,
func initLogging(c *conf) {

year, month, day := time.Now().Date()
if _, err := os.Stat(c.PatchLogFile); os.IsNotExist(err) {
os.Mkdir(c.PatchLogFile, 2)
if _, err := os.Stat(c.PathLogFile); os.IsNotExist(err) {
os.Mkdir(c.PathLogFile, 2)
}

logFileName := c.PatchLogFile + "techLog1C_" + strconv.Itoa(year) + strconv.Itoa(int(month)) + strconv.Itoa(day) + ".json"
logFileName := c.PathLogFile + "techLog1C_" + strconv.Itoa(year) + strconv.Itoa(int(month)) + strconv.Itoa(day) + ".json"
fileLog, err := os.OpenFile(logFileName, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0666)

if err != nil {
Expand All @@ -640,7 +640,7 @@ func deleteOldLogFiles(c *conf) {
lifeSpan = 1
}

files, err := getFilesArray(c.PatchLogFile)
files, err := getFilesArray(c.PathLogFile)
if err != nil {
logr.WithFields(logr.Fields{
"object": "Scan log directory",
Expand Down Expand Up @@ -754,7 +754,7 @@ func main() {
c := make(chan int)

// получаем файлы логов, сортируем по размеру, определяем в пакеты заданий
arr, err := getFilesArray(config.Patch)
arr, err := getFilesArray(config.Path)
if err != nil {
logr.WithFields(logr.Fields{
"object": "Data",
Expand Down

0 comments on commit 5e24656

Please sign in to comment.