logging

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

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/Axot017/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

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

func NewContext

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

NewContext returns a copy of parent with an associated RequestContext.

func WithDecisionID

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

func WithHTTPRequestContext

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

Types

type HTTPRequestContext

type HTTPRequestContext = v1.HTTPRequestContext

func HTTPRequestContextFromContext

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

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

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

func Get() *StandardLogger

Get returns the standard logger used throughout OPA.

Deprecated. Do not rely on the global logger.

func New

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