I am trying to use logrus to write the CSV as logs. But I see the log level (info) and the time getting added to the CSV content in logs.
It looks like you definitely shouldn't be using logrus, as the main reason it exists is creating structured logs, i.e. key-value style. Not sure why don't you simply do
fmt.Println("100,Click,Android")
or
fmt.Fprintln(os.Stderr, "100,Click,Android")
if you want it to be written into the standard error (default for loggers).
If for any reason you need a logger, you can pretty much do the same thing with the standard logger by disabling flags:
log.SetFlags(0)
log.Println("100,Click,Android")
// Output:
// 100,Click,Android
However, if you're creating a CSV output yourself (i.e. you have spearate fields rather than full CSV lines already), use csv package from the standard library:
w := csv.NewWriter(os.Stdout)
w.Write([]string{"100", "Click", "Android"})
w.Flush()
// Output:
// 100,Click,Android
Unless you just want to use logrus, then follow the concept of the package and stick with structured output:
logrus.WithFields(logrus.Fields{
"id": "100",
"event": "Click",
"os": "Android",
}).Info("Hooray, we have some users!")
// Output:
// time="2015-11-19T15:20:32+01:00" level=info msg="Hooray, we have some users!" event=Click id=100 os=Android