summaryrefslogtreecommitdiff
path: root/output.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-30 20:48:24 -0600
committerJeff Carr <[email protected]>2023-12-30 20:48:24 -0600
commitd7d3fbc3a31dbba4de1737244f39945608e5a0ac (patch)
tree6e37fcd9ffaec23dbc81fe2d0fb57e3813bed540 /output.go
parent424a1b42e294e89a6f893196ebf23ba3d20572db (diff)
more or less functional draft
Diffstat (limited to 'output.go')
-rw-r--r--output.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/output.go b/output.go
new file mode 100644
index 0000000..8077332
--- /dev/null
+++ b/output.go
@@ -0,0 +1,19 @@
+package log
+
+import (
+ "os"
+ golanglog "log"
+)
+
+// start writing all the logging to a tmp file
+func SetTmp() {
+ f, err := os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
+ if err != nil {
+ golanglog.Fatalf("error opening file: %v", err)
+ }
+ // hmm. is there a trick here or must this be in main()
+ // defer f.Close()
+
+ golanglog.SetOutput(f)
+ golanglog.Println("This is a test log entry")
+}