You can use a different logging library like logrus or modify your standard log library like this:
log package:
// 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)
with usage:
Error.Println("this is an error")
and the result would be:

log.Print,log.Printf, andlog.Println.logpackage does not provide a 4th variant. You havePrint,Fatal, andPanic. And all of them are very basic, 2-3 lines-of-code functions, that just callfmt.Sprintand write the output of that to stdout. If you require behavior different from what's provided bylogyou can implement your own error logging function, just take a peek at those functions' source code, and write your own variant.if