From 5766e86595bb7bc4c16c37f8ed47bcf0db25d82b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 28 Dec 2023 12:35:05 -0600 Subject: initial commit Signed-off-by: Jeff Carr --- info.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 info.go (limited to 'info.go') diff --git a/info.go b/info.go new file mode 100644 index 0000000..b390062 --- /dev/null +++ b/info.go @@ -0,0 +1,23 @@ +package log + +import ( + "os" + golanglog "log" +) + +func Info(a ...any) { + golanglog.Println(a...) +} + +// 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") +} -- cgit v1.2.3