initial
This commit is contained in:
23
main.go
Normal file
23
main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
logtype := os.Getenv("LOG_TYPE")
|
||||
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))
|
||||
if logtype == "json" {
|
||||
logger = slog.New(slog.NewJSONHandler(os.Stdout, nil))
|
||||
}
|
||||
logger.Info("Hello world!")
|
||||
|
||||
ticker := time.NewTicker(1 * time.Second)
|
||||
defer ticker.Stop()
|
||||
|
||||
for _ = range ticker.C {
|
||||
logger.Info("Ticking")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user