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 66c52f8 commit 0694c52
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions logger_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ func FormatMessage(message Message) *Message {
return &message
}

func CreateFileDay2(message Message, logger *log.Logger) {
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")
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{}
Expand Down

0 comments on commit 0694c52

Please sign in to comment.