File size: 587 Bytes
b025147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b55a115
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package utils

import (
	"fmt"
	"log"
	"os"
)

func InternalErrorLog(err_log error) {
	fmt.Println("There is an error!")

	file, err := os.OpenFile("logs/error_log.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)

	if err != nil {
		log.Fatal(err)
	}
	log.Println("Error Log :", err_log)
	log.SetOutput(file)
}

func SecurityLog(security_log string) {
	fmt.Println("There is an error!")

	file, err := os.OpenFile("logs/security_log.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)

	if err != nil {
		log.Fatal(err)
	}
	log.Println("Security Log :", security_log)
	log.SetOutput(file)
}