mirror of
https://github.com/pcvolkmer/idicon.git
synced 2025-04-19 16:46:50 +00:00
Log configuration file being used to start
This commit is contained in:
parent
ad1dfec739
commit
71836ecc81
@ -69,8 +69,10 @@ func configure(configFile string) {
|
|||||||
if file, err := os.OpenFile(configFile, os.O_RDONLY, 0); err == nil {
|
if file, err := os.OpenFile(configFile, os.O_RDONLY, 0); err == nil {
|
||||||
c := &Config{}
|
c := &Config{}
|
||||||
_, err := toml.NewDecoder(file).Decode(c)
|
_, err := toml.NewDecoder(file).Decode(c)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
log.Printf("Invalid config file '%s' - ignore it.\n", configFile)
|
log.Printf("Using configuration file '%s'", configFile)
|
||||||
|
} else {
|
||||||
|
log.Printf("Invalid configuration file '%s' - ignore it.\n", configFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
@ -96,6 +98,6 @@ func main() {
|
|||||||
|
|
||||||
router := mux.NewRouter()
|
router := mux.NewRouter()
|
||||||
router.HandleFunc("/avatar/{id}", requestHandler)
|
router.HandleFunc("/avatar/{id}", requestHandler)
|
||||||
log.Println(fmt.Sprintf("Starting on port %d ...", *port))
|
log.Printf("Starting on port %d ...\n", *port)
|
||||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), router))
|
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), router))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user