Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
b2f07139
Commit
b2f07139
authored
Mar 08, 2016
by
JessonChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename files to mulitfile
parent
54b5120a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
mulitfile.go
logs/mulitfile.go
+6
-6
No files found.
logs/mulitfile.go
View file @
b2f07139
...
...
@@ -24,7 +24,7 @@ import (
// means if the file name in configuration is project.log filesLogWriter will create project.error.log/project.debug.log
// and write the error-level logs to project.error.log and write the debug-level logs to project.debug.log
// the rotate attribute also acts like fileLogWriter
type
files
LogWriter
struct
{
type
mulitFile
LogWriter
struct
{
writers
[
LevelDebug
+
1
+
1
]
*
fileLogWriter
// the last one for fullLogWriter
fullLogWriter
*
fileLogWriter
Separate
[]
string
`json:"separate"`
...
...
@@ -45,7 +45,7 @@ var levelNames = [...]string{"emergency", "alert", "critical", "error", "warning
// "separate":["emergency", "alert", "critical", "error", "warning", "notice", "info", "debug"],
// }
func
(
f
*
files
LogWriter
)
Init
(
config
string
)
error
{
func
(
f
*
mulitFile
LogWriter
)
Init
(
config
string
)
error
{
writer
:=
newFileWriter
()
.
(
*
fileLogWriter
)
err
:=
writer
.
Init
(
config
)
if
err
!=
nil
{
...
...
@@ -76,7 +76,7 @@ func (f *filesLogWriter) Init(config string) error {
return
nil
}
func
(
f
*
files
LogWriter
)
Destroy
()
{
func
(
f
*
mulitFile
LogWriter
)
Destroy
()
{
for
i
:=
0
;
i
<
len
(
f
.
writers
);
i
++
{
if
f
.
writers
[
i
]
!=
nil
{
f
.
writers
[
i
]
.
Destroy
()
...
...
@@ -84,7 +84,7 @@ func (f *filesLogWriter) Destroy() {
}
}
func
(
f
*
files
LogWriter
)
WriteMsg
(
when
time
.
Time
,
msg
string
,
level
int
)
error
{
func
(
f
*
mulitFile
LogWriter
)
WriteMsg
(
when
time
.
Time
,
msg
string
,
level
int
)
error
{
if
f
.
fullLogWriter
!=
nil
{
f
.
fullLogWriter
.
WriteMsg
(
when
,
msg
,
level
)
}
...
...
@@ -98,7 +98,7 @@ func (f *filesLogWriter) WriteMsg(when time.Time, msg string, level int) error {
return
nil
}
func
(
f
*
files
LogWriter
)
Flush
()
{
func
(
f
*
mulitFile
LogWriter
)
Flush
()
{
for
i
:=
0
;
i
<
len
(
f
.
writers
);
i
++
{
if
f
.
writers
[
i
]
!=
nil
{
f
.
writers
[
i
]
.
Flush
()
...
...
@@ -108,7 +108,7 @@ func (f *filesLogWriter) Flush() {
// newFilesWriter create a FileLogWriter returning as LoggerInterface.
func
newFilesWriter
()
Logger
{
return
&
files
LogWriter
{}
return
&
mulitFile
LogWriter
{}
}
func
init
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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