Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 1.62 KB

README.md

File metadata and controls

77 lines (55 loc) · 1.62 KB

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.