golang 覆盖fmt.Printf

覆盖fmt.Printf方法

package "libs"

func LogPrintf(format string, args ...interface{}) {
    message := fmt.Sprintf(format, args)
    //重新把message写入到文件或者其他地方
    R_L(message, false)
}

替换shell

sed -i "s/fmt.Printf/LogPrintf/" *.go