From 48818d12004a143b657d0bb36cba4287e778369a Mon Sep 17 00:00:00 2001 From: Santiago Ramirez Date: Tue, 19 Dec 2023 14:38:10 +0000 Subject: [PATCH] feat: logger --- kreacher/logger.go | 19 +++++++++++++++++++ kreacher/{__main__.py => main.go} | 0 2 files changed, 19 insertions(+) create mode 100644 kreacher/logger.go rename kreacher/{__main__.py => main.go} (100%) diff --git a/kreacher/logger.go b/kreacher/logger.go new file mode 100644 index 0000000..3f93f93 --- /dev/null +++ b/kreacher/logger.go @@ -0,0 +1,19 @@ +package kreacher + +import ( + "log" + "log/syslog" +) + +func NewLogger() *log.Logger { + var logger *log.Logger + + syslogWriter, err := syslog.New(syslog.LOG_INFO, "my-app") + if err != nil { + log.Fatal(err) + } + logger.SetOutput(syslogWriter) + logger.SetFlags(0) + + return logger +} diff --git a/kreacher/__main__.py b/kreacher/main.go similarity index 100% rename from kreacher/__main__.py rename to kreacher/main.go