newrelic

package
v0.25.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 6 Imported by: 5

Documentation

Overview

Package newrelic is a wrapper of the original "github.com/newrelic/go-agent/v3/newrelic".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is newrelic client.

func New

func New(cfg Config) (*Client, error)

New to create new newrelic client.

func NewFromNewrelicApp added in v0.19.0

func NewFromNewrelicApp(app *newrelic.Application, level LogLevel) *Client

NewFromNewrelic to create new newrelic client with existing newrelic app.

Don't forget to use `newrelic.ConfigAppLogForwardingEnabled(true)` when initializing your newrelic.

func (*Client) Debug

func (c *Client) Debug(str string, args ...interface{})

Debug to print debug log.

func (*Client) Error

func (c *Client) Error(str string, args ...interface{})

Error to print error log.

func (*Client) Fatal

func (c *Client) Fatal(str string, args ...interface{})

Fatal to print fatal log. Will exit the program when called.

func (*Client) Info

func (c *Client) Info(str string, args ...interface{})

Info to print info log.

func (*Client) Log

func (c *Client) Log(fields map[string]interface{})

Log to print general log. Key `level` can be used to differentiate log level.

func (*Client) Panic

func (c *Client) Panic(str string, args ...interface{})

Panic to print panic log. Will print panic error stack and exit like panic().

func (*Client) Trace

func (c *Client) Trace(str string, args ...interface{})

Trace to print trace log.

func (*Client) Warn

func (c *Client) Warn(str string, args ...interface{})

Warn to print warn log.

type Config

type Config struct {
	Name       string
	LicenseKey string
	Level      LogLevel
}

Config is newrelic config.

type LogLevel

type LogLevel int8

LogLevel is level of log that will be printed. Will print level that is higher than your chosen one.

const (
	TraceLevel LogLevel = iota - 1
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel
	Disabled
)

Available log levec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL