Skip to content

Commit

Permalink
Resolves #47
Browse files Browse the repository at this point in the history
  • Loading branch information
eoussama committed Dec 31, 2020
1 parent 3f07411 commit e74aac2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/shared/utils/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"log"
"os"
"path/filepath"
"strconv"
"time"
)

// Logging dump location
var logDirectory = "logs"
var logFile = "anusic-api.log"

// InfoLogger hosts the logger that logs info
var InfoLogger *log.Logger
Expand All @@ -23,6 +24,10 @@ var ErrorLogger *log.Logger
// init initializes the logger
func init() {

// Constructing the log file name
timestamp := time.Now().Unix()
logFile := strconv.Itoa(int(timestamp)) + ".log"

// Constructing the logs path
absPath, _ := filepath.Abs(".")
directoryPath := filepath.Join(absPath, logDirectory)
Expand Down

0 comments on commit e74aac2

Please sign in to comment.