Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Repository files navigation

Warning

This project is archived and no longer maintained. Consider using log/slog instead.

Read more about why it was archived in this post.

Logur adapter for apex/log

GitHub Workflow Status Codecov Go Report Card Go Version go.dev reference

Installation

go get logur.dev/adapter/apex

Usage

With no initial context:

package main

import (
  apexadapter "logur.dev/adapter/apex"
)

func main() {
  logger := apexadapter.New()
}

With existing fields:

package main

import (
  "github.com/apex/log"
  apexadapter "logur.dev/adapter/apex"
)

func main() {
  logger := apexadapter.NewFromFields(log.Fields{
    "hostname": "localhost",
  })
}

With an existing entry:

package main

import (
  "github.com/apex/log"
  apexadapter "logur.dev/adapter/apex"
)

func main() {
  entry := log.WithFields(log.Fields{
    "hostname": "localhost",
  })

  logger := apexadapter.NewFromEntry(entry)
}

Development

When all coding and testing is done, please run the test suite:

$ make check

License

The MIT License (MIT). Please see License File for more information.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from logur/adapter-template