Updated Logger
This commit is contained in:
parent
a3c91dd677
commit
b9dd4ba1ef
1 changed files with 6 additions and 0 deletions
|
|
@ -13,6 +13,12 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func LoggerInit() {
|
func LoggerInit() {
|
||||||
|
|
||||||
|
dirErr := os.Mkdir("logs", 0775)
|
||||||
|
if dirErr != nil{
|
||||||
|
log.Fatal(dirErr)
|
||||||
|
}
|
||||||
|
|
||||||
file, err := os.OpenFile("logs/" + time.Now().Format("07-21-2001") + ".log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
|
file, err := os.OpenFile("logs/" + time.Now().Format("07-21-2001") + ".log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
|
||||||
if err != nil{
|
if err != nil{
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
|
||||||
Reference in a new issue