Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pkg
loggerx
Commits
3ebbf617
Commit
3ebbf617
authored
9 months ago
by
Yun
Browse files
Options
Download
Email Patches
Plain Diff
文件的时区
parent
7eb883bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
filePath.go
+5
-5
filePath.go
with
5 additions
and
5 deletions
+5
-5
filePath.go
+
5
-
5
View file @
3ebbf617
...
...
@@ -19,19 +19,19 @@ func (l *Logger) nowFileName(event string) string {
switch
l
.
option
.
fileSplit
{
case
FileSplitTimeA
:
// (年/月/日/时)
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
Local
(
)
.
Format
(
"2006/01/02/15"
))
// 2006-01-02 15:04:05
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
In
(
l
.
option
.
timeZone
)
.
Format
(
"2006/01/02/15"
))
// 2006-01-02 15:04:05
case
FileSplitTimeB
:
// (年/月/日)
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
Local
(
)
.
Format
(
"2006/01/02"
))
// 2006-01-02 15:04:05
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
In
(
l
.
option
.
timeZone
)
.
Format
(
"2006/01/02"
))
// 2006-01-02 15:04:05
case
FileSplitTimeC
:
// (年/月-日)
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
Local
(
)
.
Format
(
"2006/01-02"
))
// 2006-01-02 15:04:05
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
In
(
l
.
option
.
timeZone
)
.
Format
(
"2006/01-02"
))
// 2006-01-02 15:04:05
case
FileSplitTimeD
:
// (年-月-日-时)
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
Local
(
)
.
Format
(
"2006-01-02-15"
))
// 2006-01-02 15:04:05
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
In
(
l
.
option
.
timeZone
)
.
Format
(
"2006-01-02-15"
))
// 2006-01-02 15:04:05
case
FileSplitTimeE
:
// (年-月-日)
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
Local
(
)
.
Format
(
"2006-01-02"
))
// 2006-01-02 15:04:05
prefix
=
fmt
.
Sprint
(
time
.
Now
()
.
In
(
l
.
option
.
timeZone
)
.
Format
(
"2006-01-02"
))
// 2006-01-02 15:04:05
}
if
prefix
!=
""
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets