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()