Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
68d4c2c0
authored
2013-12-19 12:22:30 +0800
by
slene
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: AppPath is wrong. Move BeeLogger to config.go init.
1 parent
de0113ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
config.go
log.go
config.go
View file @
68d4c2c
...
...
@@ -3,12 +3,13 @@ package beego
import
(
"html/template"
"os"
"path"
"path
/filepath
"
"runtime"
"strconv"
"strings"
"github.com/astaxie/beego/config"
"github.com/astaxie/beego/logs"
"github.com/astaxie/beego/session"
)
...
...
@@ -64,8 +65,8 @@ func init() {
BeeApp
=
NewApp
()
// initialize default configurations
os
.
Chdir
(
path
.
Dir
(
os
.
Args
[
0
]))
AppPath
=
path
.
Dir
(
os
.
Args
[
0
]
)
AppPath
,
_
=
filepath
.
Abs
(
file
path
.
Dir
(
os
.
Args
[
0
]))
os
.
Chdir
(
AppPath
)
StaticDir
=
make
(
map
[
string
]
string
)
StaticDir
[
"/static"
]
=
"static"
...
...
@@ -103,7 +104,7 @@ func init() {
EnableGzip
=
false
AppConfigPath
=
path
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
AppConfigPath
=
file
path
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
HttpServerTimeOut
=
0
...
...
@@ -123,6 +124,10 @@ func init() {
runtime
.
GOMAXPROCS
(
runtime
.
NumCPU
())
// init BeeLogger
BeeLogger
=
logs
.
NewLogger
(
10000
)
BeeLogger
.
SetLogger
(
"console"
,
""
)
err
:=
ParseConfig
()
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
// for init if doesn't have app.conf will not panic
...
...
log.go
View file @
68d4c2c
...
...
@@ -25,11 +25,6 @@ func SetLevel(l int) {
// logger references the used application logger.
var
BeeLogger
*
logs
.
BeeLogger
func
init
()
{
BeeLogger
=
logs
.
NewLogger
(
10000
)
BeeLogger
.
SetLogger
(
"console"
,
""
)
}
// SetLogger sets a new logger.
func
SetLogger
(
adaptername
string
,
config
string
)
{
BeeLogger
.
SetLogger
(
adaptername
,
config
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment