Golang Log Error Without Exit

[Solved] Golang Log Error Without Exit | Erlang - Code Explorer | yomemimo.com
Question : golang log error without exit

Answered by : motionless-macaque-0kzlj0w43osg

// Info writes logs in the color blue with "INFO: " as prefix
var Info = log.New(os.Stdout, "\u001b[34mINFO: \u001B[0m", log.LstdFlags|log.Lshortfile)
// Warning writes logs in the color yellow with "WARNING: " as prefix
var Warning = log.New(os.Stdout, "\u001b[33mWARNING: \u001B[0m", log.LstdFlags|log.Lshortfile)
// Error writes logs in the color red with "ERROR: " as prefix
var Error = log.New(os.Stdout, "\u001b[31mERROR: \u001b[0m", log.LstdFlags|log.Lshortfile)
// Debug writes logs in the color cyan with "DEBUG: " as prefix
var Debug = log.New(os.Stdout, "\u001b[36mDEBUG: \u001B[0m", log.LstdFlags|log.Lshortfile)

Source : https://stackoverflow.com/questions/60721367/how-to-log-error-without-exit-the-program-in-golang | Last Update : Fri, 16 Sep 22

Answers related to golang log error without exit

Code Explorer Popular Question For Erlang