added server logging to file, added logging and formatting to info and lock commands

This commit is contained in:
2020-06-09 23:22:07 -04:00
parent 441a9ed233
commit 161843f4c8
15 changed files with 126 additions and 66 deletions

View File

@@ -40,6 +40,10 @@ func ValidateConfig(conf *GvcServerConfig, configPath string, version string) er
fmt.Printf("No version found, inputing current server version: %s\n", version)
conf.Version = version
}
if conf.LogFile == "" { // If no log file specified, set log location
fmt.Printf("No logfile found in config, setting it to: gvclog.log :in root dir:")
conf.LogFile = "gvclog.log"
}
if conf.RepoRootPath == "" {
fmt.Println("Repo root path: ", conf.RepoRootPath)
path, err := os.Getwd()

View File

@@ -4,6 +4,7 @@ import "github.com/deranjer/gvc/common"
// GvcServerConfig will hold the base server settings
type GvcServerConfig struct {
LogFile string `toml:"logfile"` // Where to store the echo logs
Version string `toml:"version"` // The server version
Port int `toml:"port"` // The port that the server will listed on
BindIP string `toml:"ip"` // What IP to bind the server to. If empty will bind to all interfaces