Add a logger prefix
This commit is contained in:
parent
347f317dd9
commit
c137969b6a
@ -31,6 +31,8 @@ func main() {
|
|||||||
flag.StringVar(&CloudPassword, "cloudpass", "", "Password used to sync")
|
flag.StringVar(&CloudPassword, "cloudpass", "", "Password used to sync")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
log.SetPrefix("[admin] ")
|
||||||
|
|
||||||
var staticDir string
|
var staticDir string
|
||||||
var err error
|
var err error
|
||||||
log.Println("Checking paths...")
|
log.Println("Checking paths...")
|
||||||
|
@ -48,6 +48,8 @@ func main() {
|
|||||||
var skipFullGeneration = flag.Bool("skipFullGeneration", false, "Skip initial full generation (safe to skip after start)")
|
var skipFullGeneration = flag.Bool("skipFullGeneration", false, "Skip initial full generation (safe to skip after start)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
log.SetPrefix("[backend] ")
|
||||||
|
|
||||||
SubmissionDir = path.Clean(SubmissionDir)
|
SubmissionDir = path.Clean(SubmissionDir)
|
||||||
|
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
@ -37,6 +37,8 @@ func main() {
|
|||||||
flag.StringVar(&SubmissionDir, "submission", "./submissions/", "Base directory where save submissions")
|
flag.StringVar(&SubmissionDir, "submission", "./submissions/", "Base directory where save submissions")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
log.SetPrefix("[frontend] ")
|
||||||
|
|
||||||
log.Println("Creating submission directory...")
|
log.Println("Creating submission directory...")
|
||||||
if _, err := os.Stat(SubmissionDir); os.IsNotExist(err) {
|
if _, err := os.Stat(SubmissionDir); os.IsNotExist(err) {
|
||||||
if err := os.MkdirAll(SubmissionDir, 0777); err != nil {
|
if err := os.MkdirAll(SubmissionDir, 0777); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user