logging

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 36

Documentation

Overview

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Index

Constants

View Source
const (
	// Error error log level
	Error = v1.Error
	// Warn warn log level
	Warn = v1.Warn
	// Info info log level
	Info = v1.Info
	// Debug debug log level
	Debug = v1.Debug
)

Variables

This section is empty.

Functions

func DecisionIDFromContext added in v0.50.0

func DecisionIDFromContext(ctx context.Context) (string, bool)

func NewContext added in v0.46.0

func NewContext(parent context.Context, val *RequestContext) context.Context

NewContext returns a copy of parent with an associated RequestContext.

func WithDecisionID added in v0.50.0

func WithDecisionID(parent context.Context, id string) context.Context

func WithHTTPRequestContext added in v0.68.0

func WithHTTPRequestContext(parent context.Context, val *HTTPRequestContext) context.Context

Types

type HTTPRequestContext added in v0.65.0

type HTTPRequestContext = v1.HTTPRequestContext

func HTTPRequestContextFromContext added in v0.68.0

func HTTPRequestContextFromContext(ctx context.Context) (*HTTPRequestContext, bool)

type Level

type Level = v1.Level

Level log level for Logger

type Logger

type Logger = v1.Logger

Logger provides interface for OPA logger implementations

type NoOpLogger

type NoOpLogger = v1.NoOpLogger

NoOpLogger logging implementation that does nothing

func NewNoOpLogger

func NewNoOpLogger() *NoOpLogger

NewNoOpLogger instantiates new NoOpLogger

type RequestContext added in v0.46.0

type RequestContext = v1.RequestContext

RequestContext represents the request context used to store data related to the request that could be used on logs.

func FromContext added in v0.46.0

func FromContext(ctx context.Context) (*RequestContext, bool)

FromContext returns the RequestContext associated with ctx, if any.

type StandardLogger

type StandardLogger = v1.StandardLogger

StandardLogger is the default OPA logger implementation.

func Get added in v0.31.0

func Get() *StandardLogger

Get returns the standard logger used throughout OPA.

Deprecated. Do not rely on the global logger.

func New added in v0.31.0

func New() *StandardLogger

New returns a new standard logger.

Directories

Path Synopsis
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended.
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended.

Jump to

Keyboard shortcuts

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