Skip to content

Commit

Permalink
teste
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-couto committed Mar 17, 2022
1 parent 0694c52 commit f4dfb5c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions logger_file.go
Original file line number Diff line number Diff line change
@@ -36,24 +36,19 @@ func FormatMessage(message Message) *Message {
return &message
}

func CreateFileDay2(message Message, logger *log.Logger) {
func CreateFileDay2(message Message) {
message.Query = strings.ReplaceAll(message.Query, "\n", "")
f, err := os.OpenFile(fmt.Sprint(time.Now().Format("20060102"), ".log"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Println(err)
}
defer f.Close()

logger.Println("dfdsfhdksfsdkfjsdkfsdf")
log.SetFlags(log.LstdFlags | log.Lshortfile)
log.Println("dfdsfhdksfsdkfjsdkfsdf")
fmt.Println(message)
}

func FormatMessage2(message Message) (Message, *log.Logger) {
logger := log.Logger{}
logger.SetFlags(log.LstdFlags | log.Lshortfile)
return message, &logger
}

type MongoObject2 struct {
Date time.Time
Object interface{}

0 comments on commit f4dfb5c

Please sign in to comment.