logz

package
v16.11.10 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 10 Imported by: 0

README

The logz package

The logz package should be used to re-use existing log fields (zap.Field) and helpers. New log fields can be added in case they don't drag in any new dependency. In case the log field requires a new dependency, you should define the log field name in fields.go and define the zap.Field helper in the module where it's used.

Log field names

Log field names must be in snake_case.

Documentation

Index

Constants

View Source
const (
	AgentConfig = "agent_config"
	ApplyEvent  = "apply_event"
)

Variables

This section is empty.

Functions

func AgentID added in v16.9.0

func AgentID(agentID int64) zap.Field

func CommitID added in v16.9.0

func CommitID(commitID string) zap.Field

func DurationInMilliseconds

func DurationInMilliseconds(duration time.Duration) zap.Field

func Error

func Error(err error) zap.Field

func GRPCMethod added in v16.9.0

func GRPCMethod(method string) zap.Field

func GRPCService added in v16.9.0

func GRPCService(service string) zap.Field

func GitRef

func GitRef(gitRef string) zap.Field

func GitRepositoryURL added in v16.9.0

func GitRepositoryURL(url string) zap.Field

func InventoryName added in v16.3.0

func InventoryName(name string) zap.Field

func InventoryNamespace added in v16.5.0

func InventoryNamespace(namespace string) zap.Field

func IsWebSocket

func IsWebSocket(isWebSocket bool) zap.Field

func K8sGroup added in v16.1.0

func K8sGroup(groupName string) zap.Field

func K8sObjectName added in v16.9.0

func K8sObjectName(name string) zap.Field

func K8sResource added in v16.1.0

func K8sResource(resourceName string) zap.Field

func KASURL added in v16.9.0

func KASURL(kasURL string) zap.Field

func LevelFromString

func LevelFromString(levelStr string) (zapcore.Level, error)

func ModuleName

func ModuleName(name string) zap.Field

GitLab-kas or agentk module name.

func NamespacedName added in v16.1.0

func NamespacedName(n string) zap.Field

func NetAddress

func NetAddress(listenAddress string) zap.Field

func NetAddressFromAddr

func NetAddressFromAddr(addr net.Addr) zap.Field

func NetNetwork

func NetNetwork(listenNetwork string) zap.Field

func NetNetworkFromAddr

func NetNetworkFromAddr(addr net.Addr) zap.Field

func NewProductionEncoderConfig

func NewProductionEncoderConfig() zapcore.EncoderConfig

func NoSync

func NoSync(w io.Writer) zapcore.WriteSyncer

NoSync can be used to wrap a io.Writer that implements zapcore.WriteSyncer but does not actually support the Sync() operation. An example is os.Stderr that returns "sync /dev/stderr: inappropriate ioctl for device" on sync attempt.

func NumberOfFilesSent

func NumberOfFilesSent(n uint32) zap.Field

func NumberOfFilesVisited

func NumberOfFilesVisited(n uint32) zap.Field

func ObjectKey added in v16.1.0

func ObjectKey(obj interface{}) zap.Field

func PayloadSizeInBytes

func PayloadSizeInBytes(size int) zap.Field

func PodLog

func PodLog(podLog string) zap.Field

func PodName

func PodName(podName string) zap.Field

func PodStatus

func PodStatus(podStatus string) zap.Field

func PoolConnectionURL added in v16.9.0

func PoolConnectionURL(poolConnURL string) zap.Field

func ProjectID added in v16.9.0

func ProjectID(projectID string) zap.Field

ProjectID is the human-readable GitLab project path (e.g. gitlab-org/gitlab).

func ProjectsToReconcile added in v16.1.0

func ProjectsToReconcile(p []string) zap.Field

func ProtoJSONValue added in v16.9.0

func ProtoJSONValue(key string, value proto.Message) zap.Field

func RedisKey

func RedisKey(key []byte) zap.Field

Use for any keys in Redis.

func RemovedHashKeys

func RemovedHashKeys(n int) zap.Field

func RequestID added in v16.9.0

func RequestID(requestID string) zap.Field

func StatusCode

func StatusCode(code int32) zap.Field

func TargetNamespace

func TargetNamespace(namespace string) zap.Field

func TokenLimit

func TokenLimit(limit uint64) zap.Field

Use for any integer counters.

func TraceID added in v16.9.0

func TraceID(traceID trace.TraceID) zap.Field

func TraceIDFromContext added in v16.9.0

func TraceIDFromContext(ctx context.Context) zap.Field

func TunnelsByAgent added in v16.9.0

func TunnelsByAgent(numTunnels int) zap.Field

func U64Count

func U64Count(count uint64) zap.Field

Use for any integer counters.

func URL added in v16.9.0

func URL(url string) zap.Field

func URLPath added in v16.9.0

func URLPath(url string) zap.Field

func URLPathPrefix added in v16.9.0

func URLPathPrefix(urlPrefix string) zap.Field

func VulnerabilitiesCount

func VulnerabilitiesCount(n int) zap.Field

func WorkspaceDataCount

func WorkspaceDataCount(count int) zap.Field

func WorkspaceName

func WorkspaceName(name string) zap.Field

func WorkspaceNamespace

func WorkspaceNamespace(namespace string) zap.Field

Types

This section is empty.

Jump to

Keyboard shortcuts

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