SoFunction
Updated on 2025-03-05

Example analysis of simple usage method of go language logging library

package main
import (
 "fmt"
 "log"
 "os"
)
func main(){
 logfile,err := ("/var/golang/",os.O_RDWR|os.O_CREATE,0);
 if err!=nil {
  ("%s\r\n",());
  (-1);
 }
 defer ();
 logger := (logfile,"\r\n",||);
 ("hello");
 ("oh....");
 ("test");
 ("test2");
}