This commit is contained in:
Andre Heber
2024-08-20 23:51:59 +02:00
commit ea3b86e8cd
20 changed files with 120 additions and 0 deletions

26
main.go Normal file
View File

@ -0,0 +1,26 @@
package main
import (
"log"
"os"
"time"
)
func main() {
// Configure logging to include timestamp
log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
// Read LOG_LEVEL from environment variable
logLevel := os.Getenv("LOG_LEVEL")
if logLevel == "" {
logLevel = "INFO" // Default log level
}
log.Printf("Starting application with LOG_LEVEL: %s", logLevel)
// Infinite loop to log every 2 seconds
for {
log.Printf("Current LOG_LEVEL: %s", logLevel)
time.Sleep(2 * time.Second)
}
}