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
3f1de576
Commit
3f1de576
authored
Apr 04, 2014
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix go run hello.go & console log
parent
f48ca96a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
12 deletions
+7
-12
beego.go
beego.go
+1
-1
config.go
config.go
+6
-2
conn.go
logs/conn.go
+0
-3
file.go
logs/file.go
+0
-3
smtp.go
logs/smtp.go
+0
-3
No files found.
beego.go
View file @
3f1de576
...
...
@@ -188,7 +188,7 @@ func initBeforeHttpRun() {
// if AppConfigPath not In the conf/app.conf reParse config
if
AppConfigPath
!=
filepath
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
{
err
:=
ParseConfig
()
if
err
!=
nil
{
if
err
!=
nil
&&
AppConfigPath
!=
filepath
.
Join
(
workPath
,
"conf"
,
"app.conf"
)
{
// configuration is critical to app, panic here if parse failed
panic
(
err
)
}
...
...
config.go
View file @
3f1de576
package
beego
import
(
"fmt"
"html/template"
"os"
"path/filepath"
...
...
@@ -143,9 +144,12 @@ func init() {
// init BeeLogger
BeeLogger
=
logs
.
NewLogger
(
10000
)
BeeLogger
.
SetLogger
(
"console"
,
""
)
err
:=
BeeLogger
.
SetLogger
(
"console"
,
""
)
if
err
!=
nil
{
fmt
.
Println
(
"init console log error:"
,
err
)
}
err
:
=
ParseConfig
()
err
=
ParseConfig
()
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
// for init if doesn't have app.conf will not panic
Info
(
err
)
...
...
logs/conn.go
View file @
3f1de576
...
...
@@ -29,9 +29,6 @@ func NewConn() LoggerInterface {
// init connection writer with json config.
// json config only need key "level".
func
(
c
*
ConnWriter
)
Init
(
jsonconfig
string
)
error
{
if
len
(
jsonconfig
)
==
0
{
return
nil
}
err
:=
json
.
Unmarshal
([]
byte
(
jsonconfig
),
c
)
if
err
!=
nil
{
return
err
...
...
logs/file.go
View file @
3f1de576
...
...
@@ -90,9 +90,6 @@ func NewFileWriter() LoggerInterface {
// "rotate":true
// }
func
(
w
*
FileLogWriter
)
Init
(
jsonconfig
string
)
error
{
if
len
(
jsonconfig
)
==
0
{
return
nil
}
err
:=
json
.
Unmarshal
([]
byte
(
jsonconfig
),
w
)
if
err
!=
nil
{
return
err
...
...
logs/smtp.go
View file @
3f1de576
...
...
@@ -38,9 +38,6 @@ func NewSmtpWriter() LoggerInterface {
// "level":LevelError
// }
func
(
s
*
SmtpWriter
)
Init
(
jsonconfig
string
)
error
{
if
len
(
jsonconfig
)
==
0
{
return
nil
}
err
:=
json
.
Unmarshal
([]
byte
(
jsonconfig
),
s
)
if
err
!=
nil
{
return
err
...
...
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