hooks

package
v0.68.2-beta2024101501 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package hooks provides hooks for the Terragrunt logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RelativePathHook

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

RelativePathHook represents a hook for logrus logger. The purpose is to replace all absolute paths found in the main message or data fields with paths relative to `baseDir`. For better performance, during instance creation, we creating a cache of relative paths for each subdirectory of baseDir.

Example of cache: /path/to/dir ./ /path/to ../ /path ../..

func NewRelativePathHook

func NewRelativePathHook(baseDir string) (*RelativePathHook, error)

NewRelativePathHook returns a new RelativePathHook instance. It returns an error if the cache of relative paths could not be created for the given `baseDir`.

func (*RelativePathHook) Fire

func (hook *RelativePathHook) Fire(entry *logrus.Entry) error

Fire implements logrus.Hook.Fire()

func (*RelativePathHook) Levels

func (hook *RelativePathHook) Levels() []logrus.Level

Levels implements logrus.Hook.Levels()

Jump to

Keyboard shortcuts

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