-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added logutils, got server config working
Added logutils for simple log filtering. Got configuration working for the http server bind address and ports. Now there is a default, which can be overridden with a configuration file, which can be overridden with a command line flag
- Loading branch information
1 parent
7599131
commit cd236dc
Showing
3 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
http: | ||
port: 3000 | ||
boltdb: | ||
database: config.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
package main | ||
|
||
import "github.com/danesparza/centralconfig/cmd" | ||
import ( | ||
"log" | ||
"os" | ||
|
||
"github.com/danesparza/centralconfig/cmd" | ||
"github.com/hashicorp/logutils" | ||
) | ||
|
||
func main() { | ||
filter := &logutils.LevelFilter{ | ||
Levels: []logutils.LogLevel{"DEBUG", "INFO", "WARN", "ERROR"}, | ||
MinLevel: logutils.LogLevel("INFO"), | ||
Writer: os.Stderr, | ||
} | ||
log.SetOutput(filter) | ||
|
||
cmd.Execute() | ||
} |