Commits

Miki Tebeka  committed 20dd35f

multiplex

  • Participants
  • Parent commits a3a1fa5

Comments (0)

Files changed (2)

 init
 libcount
 map
+multiplex
 nc
 pp
 quine

File multiplex.go

+package main
+
+import (
+	"io"
+	"log"
+	"os"
+)
+
+func init() {
+	filename := "/tmp/log.out"
+	flags := os.O_WRONLY|os.O_APPEND|os.O_CREATE
+	if file, err := os.OpenFile(filename, flags, 0666); err != nil {
+		log.Fatalf("error: can't open %s (%v)", filename, err)
+	} else {
+		log.SetOutput(io.MultiWriter(os.Stdout, file))
+	}
+}
+
+
+func main() {
+	log.Print("MOO")
+}
+