Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
1c293781
Commit
1c293781
authored
Jul 01, 2016
by
Andris Raugulis
Committed by
Torkel Ödegaard
Jun 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log to default log directory, only if custom configuration failed. (#5393)
parent
603e5fe0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
pkg/setting/setting.go
+9
-8
No files found.
pkg/setting/setting.go
View file @
1c293781
...
...
@@ -284,19 +284,19 @@ func evalConfigValues() {
}
}
func
loadSpecifedConfigFile
(
configFile
string
)
{
func
loadSpecifedConfigFile
(
configFile
string
)
error
{
if
configFile
==
""
{
configFile
=
filepath
.
Join
(
HomePath
,
"conf/custom.ini"
)
// return without error if custom file does not exist
if
!
pathExists
(
configFile
)
{
return
return
nil
}
}
userConfig
,
err
:=
ini
.
Load
(
configFile
)
userConfig
.
BlockMode
=
false
if
err
!=
nil
{
log
.
Fatal
(
3
,
"Failed to parse %v, %v"
,
configFile
,
err
)
return
fmt
.
Errorf
(
"Failed to parse %v, %v"
,
configFile
,
err
)
}
for
_
,
section
:=
range
userConfig
.
Sections
()
{
...
...
@@ -318,6 +318,7 @@ func loadSpecifedConfigFile(configFile string) {
}
configFiles
=
append
(
configFiles
,
configFile
)
return
nil
}
func
loadConfiguration
(
args
*
CommandLineArgs
)
{
...
...
@@ -339,12 +340,12 @@ func loadConfiguration(args *CommandLineArgs) {
// load default overrides
applyCommandLineDefaultProperties
(
commandLineProps
)
// init logging before specific config so we can log errors from here on
DataPath
=
makeAbsolute
(
Cfg
.
Section
(
"paths"
)
.
Key
(
"data"
)
.
String
(),
HomePath
)
initLogging
()
// load specified config file
loadSpecifedConfigFile
(
args
.
Config
)
err
=
loadSpecifedConfigFile
(
args
.
Config
)
if
err
!=
nil
{
initLogging
()
log
.
Fatal
(
3
,
err
.
Error
())
}
// apply environment overrides
applyEnvVariableOverrides
()
...
...
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