Add a logger prefix

This commit is contained in:
nemunaire 2016-10-13 19:02:41 +02:00
parent c0c6762313
commit 85cbab1d70
3 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,8 @@ func main() {
flag.StringVar(&CloudPassword, "cloudpass", "", "Password used to sync")
flag.Parse()
log.SetPrefix("[admin] ")
var staticDir string
var err error
log.Println("Checking paths...")

View File

@ -48,6 +48,8 @@ func main() {
var skipFullGeneration = flag.Bool("skipFullGeneration", false, "Skip initial full generation (safe to skip after start)")
flag.Parse()
log.SetPrefix("[backend] ")
SubmissionDir = path.Clean(SubmissionDir)
rand.Seed(time.Now().UnixNano())

View File

@ -37,6 +37,8 @@ func main() {
flag.StringVar(&SubmissionDir, "submission", "./submissions/", "Base directory where save submissions")
flag.Parse()
log.SetPrefix("[frontend] ")
log.Println("Creating submission directory...")
if _, err := os.Stat(SubmissionDir); os.IsNotExist(err) {
if err := os.MkdirAll(SubmissionDir, 0777); err != nil {