diff --git a/lokiwriter.go b/lokiwriter.go index d6de938..fa817c9 100644 --- a/lokiwriter.go +++ b/lokiwriter.go @@ -5,10 +5,7 @@ import ( "encoding/json" "fmt" "net/http" - "os" "time" - - "github.com/rs/zerolog" ) type LokiWriter struct { @@ -98,25 +95,3 @@ func (w *LokiWriter) Write(p []byte) (n int, err error) { return len(p), nil } - -func main() { - lokiURL := "http://your-loki-url/loki/api/v1/push" - labels := map[string]string{ - "app": "your_app_name", - // Add more labels as needed - } - - lokiWriter := NewLokiWriter(lokiURL, labels) - - consoleWriter := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339} - - multiWriter := zerolog.MultiLevelWriter(consoleWriter, lokiWriter) - - logger := zerolog.New(multiWriter).With().Timestamp().Logger() - - // Configure the logger in the sublibrary - sublibrary.AddLogger(logger) - - logger.Info().Msg("Main library log message") - sublibrary.SublibraryFunction() -}