Skip to content

Commit c5a7869

Browse files
lvan100lianghuan
authored andcommitted
111
1 parent a31d154 commit c5a7869

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gs/log.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ func initLog() error {
5050
extensions := []string{".properties", ".yaml", ".yml", ".xml", ".json"}
5151

5252
var files []string
53-
for _, ext := range extensions {
54-
files = append(files, filepath.Join(c.LocalDir, "log"+ext))
55-
}
56-
if c.Profiles = strings.TrimSpace(c.Profiles); c.Profiles != "" {
57-
for s := range strings.SplitSeq(c.Profiles, ",") {
53+
if profiles := strings.TrimSpace(c.Profiles); profiles != "" {
54+
for s := range strings.SplitSeq(profiles, ",") {
5855
if s = strings.TrimSpace(s); s != "" {
5956
for _, ext := range extensions {
6057
files = append(files, filepath.Join(c.LocalDir, "log-"+s+ext))
6158
}
6259
}
6360
}
6461
}
62+
for _, ext := range extensions {
63+
files = append(files, filepath.Join(c.LocalDir, "log"+ext))
64+
}
6565

6666
// Determine which log configuration file to use.
6767
var logFiles []string
@@ -72,11 +72,11 @@ func initLog() error {
7272
continue
7373
}
7474
logFiles = append(logFiles, s)
75-
break
7675
}
7776

7877
// If no configuration file exists, leave the logger as default.
7978
if n := len(logFiles); n == 0 {
79+
log.Infof(nil, log.TagAppDef, "no log configuration file found, using default logger")
8080
return nil
8181
} else if n > 1 {
8282
return util.FormatError(nil, "multiple log files found: %s", logFiles)

0 commit comments

Comments
 (0)