Documentation ¶
Index ¶
- Variables
- func Add(pathBase string) (subsystem string)
- func GetLoc(skip int, subsystem string) (output string)
- func Item(m *metadata) (t types.Item)
- func List(items ...string) []string
- func New(args Desc) *metadata
- func SetLogLevel(l LogLevel)
- func SetTimeStampFormat(format string)
- func Version() string
- type BoolT
- func (m BoolT) Aliases() []string
- func (b BoolT) Bool() bool
- func (m BoolT) Default() string
- func (m BoolT) Description() string
- func (m BoolT) Documentation() string
- func (b BoolT) Duration() time.Duration
- func (b BoolT) Float() float64
- func (b *BoolT) FromString(s string) error
- func (m BoolT) Group() string
- func (b BoolT) Int() int64
- func (b BoolT) List() []string
- func (m BoolT) Name() string
- func (b *BoolT) Set(bo bool)
- func (b BoolT) String() string
- func (m BoolT) Tags() []string
- func (m BoolT) Type() types.Type
- func (b BoolT) Uint() uint64
- type Chk
- type Configs
- type Desc
- type DurT
- func (m DurT) Aliases() []string
- func (d DurT) Bool() bool
- func (m DurT) Default() string
- func (m DurT) Description() string
- func (m DurT) Documentation() string
- func (d DurT) Duration() time.Duration
- func (d DurT) Float() float64
- func (d *DurT) FromString(s string) error
- func (m DurT) Group() string
- func (d DurT) Int() int64
- func (d DurT) List() []string
- func (m DurT) Name() string
- func (d *DurT) Set(du time.Duration)
- func (d DurT) String() string
- func (m DurT) Tags() []string
- func (m DurT) Type() types.Type
- func (d DurT) Uint() uint64
- type FltT
- func (m FltT) Aliases() []string
- func (f FltT) Bool() bool
- func (m FltT) Default() string
- func (m FltT) Description() string
- func (m FltT) Documentation() string
- func (f FltT) Duration() time.Duration
- func (f FltT) Float() float64
- func (f *FltT) FromString(s string) error
- func (m FltT) Group() string
- func (f FltT) Int() int64
- func (f FltT) List() []string
- func (m FltT) Name() string
- func (f *FltT) Set(fl float64)
- func (f FltT) String() string
- func (m FltT) Tags() []string
- func (m FltT) Type() types.Type
- func (f FltT) Uint() uint64
- type IntT
- func (m IntT) Aliases() []string
- func (in IntT) Bool() bool
- func (m IntT) Default() string
- func (m IntT) Description() string
- func (m IntT) Documentation() string
- func (in IntT) Duration() time.Duration
- func (in IntT) Float() float64
- func (in *IntT) FromString(s string) error
- func (m IntT) Group() string
- func (in IntT) Int() int64
- func (in IntT) List() []string
- func (m IntT) Name() string
- func (in *IntT) Set(i int64)
- func (in IntT) String() string
- func (m IntT) Tags() []string
- func (m IntT) Type() types.Type
- func (in IntT) Uint() uint64
- type LevelPrinter
- type LevelSpec
- type LogLevel
- type Logger
- type LstT
- func (m LstT) Aliases() []string
- func (l LstT) Bool() bool
- func (m LstT) Default() string
- func (m LstT) Description() string
- func (m LstT) Documentation() string
- func (l LstT) Duration() time.Duration
- func (l LstT) Float() float64
- func (l *LstT) FromString(s string) error
- func (m LstT) Group() string
- func (l LstT) Int() int64
- func (l LstT) List() (li []string)
- func (m LstT) Name() string
- func (l *LstT) Set(li ...string)
- func (l LstT) String() (o string)
- func (m LstT) Tags() []string
- func (m LstT) Type() types.Type
- func (l LstT) Uint() uint64
- type Printc
- type Printf
- type Println
- type Prints
- type StrT
- func (m StrT) Aliases() []string
- func (s StrT) Bool() bool
- func (m StrT) Default() string
- func (m StrT) Description() string
- func (m StrT) Documentation() string
- func (s StrT) Duration() time.Duration
- func (s StrT) Float() float64
- func (s *StrT) FromString(st string) error
- func (m StrT) Group() string
- func (s StrT) Int() int64
- func (s StrT) List() []string
- func (m StrT) Name() string
- func (s *StrT) Set(st string)
- func (s StrT) String() string
- func (m StrT) Tags() []string
- func (m StrT) Type() types.Type
- func (s StrT) Uint() uint64
- type UinT
- func (m UinT) Aliases() []string
- func (u UinT) Bool() bool
- func (m UinT) Default() string
- func (m UinT) Description() string
- func (m UinT) Documentation() string
- func (u UinT) Duration() time.Duration
- func (u UinT) Float() float64
- func (u *UinT) FromString(s string) error
- func (m UinT) Group() string
- func (u UinT) Int() int64
- func (u UinT) List() []string
- func (m UinT) Name() string
- func (u *UinT) Set(ui uint64)
- func (u UinT) String() string
- func (m UinT) Tags() []string
- func (m UinT) Type() types.Type
- func (u UinT) Uint() uint64
Constants ¶
This section is empty.
Variables ¶
var ( // App is the name of the application App = " main" // AllSubsystems stores all of the package subsystem names found in the current // application AllSubsystems []string )
var ( // URL is the git URL for the repository URL = "github.com/cybriq/proc" // GitRef is the gitref, as in refs/heads/branchname GitRef = "refs/heads/master" // ParentGitCommit is the commit hash of the parent HEAD ParentGitCommit = "f9f2f2046ce52bfad7327b6fc89af1c7b661cf6c" // BuildTime stores the time when the current binary was built BuildTime = "2022-08-01T16:51:12+02:00" // SemVer lists the (latest) git tag on the build SemVer = "v0.0.37" // PathBase is the path base returned from runtime caller PathBase = "/home/davidvennik/src/github.com/cybriq/proc/" // Major is the major number from the tag Major = 0 // Minor is the minor number from the tag Minor = 0 // Patch is the patch version number from the tag Patch = 37 )
var LevelSpecs = map[LogLevel]LevelSpec{ Off: gLS(Off, 0, 0, 0), Fatal: gLS(Fatal, 255, 0, 0), Error: gLS(Error, 255, 128, 0), Check: gLS(Check, 255, 255, 0), Warn: gLS(Warn, 255, 255, 0), Info: gLS(Info, 0, 255, 0), Debug: gLS(Debug, 0, 128, 255), Trace: gLS(Trace, 128, 0, 255), }
LevelSpecs specifies the id, string name and color-printing function
Functions ¶
func Add ¶ added in v0.0.30
Add adds a subsystem to the list of known subsystems and returns the string so it is nice and neat in the package logg.go file
func GetLoc ¶ added in v0.0.30
GetLoc calls runtime.Caller and formats as expected by source code editors for terminal hyperlinks
Regular expressions and the substitution texts to make these clickable in Tilix and other RE hyperlink configurable terminal emulators:
This matches the shortened paths generated in this command and printed at the very beginning of the line as this logger prints:
^((([\/a-zA-Z@0-9-_.]+/)+([a-zA-Z@0-9-_.]+)):([0-9]+)) /usr/local/bin/goland --line $5 $GOPATH/src/github.com/p9c/matrjoska/$2
I have used a shell variable there but tilix doesn't expand them, so put your GOPATH in manually, and obviously change the repo subpath.
func New ¶ added in v0.0.30
func New(args Desc) *metadata
New allows you to create a metadata with a sparsely filled, named field struct literal.
name, type, group and tags all will be canonicalized to lower case.
func SetLogLevel ¶ added in v0.0.30
func SetLogLevel(l LogLevel)
func SetTimeStampFormat ¶ added in v0.0.30
func SetTimeStampFormat(format string)
Types ¶
type BoolT ¶ added in v0.0.35
type BoolT struct {
// contains filtered or unexported fields
}
func (BoolT) Description ¶ added in v0.0.35
func (m BoolT) Description() string
func (BoolT) Documentation ¶ added in v0.0.35
func (m BoolT) Documentation() string
func (*BoolT) FromString ¶ added in v0.0.35
type Configs ¶ added in v0.0.30
func (*Configs) MarshalJSON ¶ added in v0.0.30
func (*Configs) UnmarshalJSON ¶ added in v0.0.30
type Desc ¶ added in v0.0.30
type Desc struct {
Name, Group, Description, Documentation, Default string
Type types.Type
Tags, Aliases []string
}
Desc is the named field form of metadata for generating a metadata
type DurT ¶ added in v0.0.35
type DurT struct {
// contains filtered or unexported fields
}
func NewDuration ¶ added in v0.0.30
func NewDuration(m *metadata) (b *DurT)
func (DurT) Description ¶ added in v0.0.35
func (m DurT) Description() string
func (DurT) Documentation ¶ added in v0.0.35
func (m DurT) Documentation() string
func (*DurT) FromString ¶ added in v0.0.35
type FltT ¶ added in v0.0.35
type FltT struct {
// contains filtered or unexported fields
}
func (FltT) Description ¶ added in v0.0.35
func (m FltT) Description() string
func (FltT) Documentation ¶ added in v0.0.35
func (m FltT) Documentation() string
func (*FltT) FromString ¶ added in v0.0.35
type IntT ¶ added in v0.0.35
type IntT struct {
// contains filtered or unexported fields
}
func (IntT) Description ¶ added in v0.0.35
func (m IntT) Description() string
func (IntT) Documentation ¶ added in v0.0.35
func (m IntT) Documentation() string
func (*IntT) FromString ¶ added in v0.0.35
type LevelPrinter ¶
type LevelPrinter struct { Ln Println // F prints like fmt.Println surrounded by log details F Printf // S uses spew.dump to show the content of a variable S Prints // C accepts a function so that the extra computation can be avoided if // it is not being viewed C Printc // Chk is a shortcut for printing if there is an error, or returning // true Chk Chk }
LevelPrinter defines a set of terminal printing primitives that output with extra data, time, level, and code location
type Logger ¶
type Logger struct {
F, E, W, I, D, T LevelPrinter
}
type LstT ¶ added in v0.0.35
func (LstT) Description ¶ added in v0.0.35
func (m LstT) Description() string
func (LstT) Documentation ¶ added in v0.0.35
func (m LstT) Documentation() string
func (*LstT) FromString ¶ added in v0.0.35
FromString converts a comma separated list of strings into a _lst
type Printc ¶
type Printc func(closure func() string)
Printc accepts a function so that the extra computation can be avoided if it is not being viewed
type Printf ¶
type Printf func(format string, a ...interface{})
Printf prints like fmt.Println surrounded by log details
type Println ¶
type Println func(a ...interface{})
Println prints lists of interfaces with spaces in between
type StrT ¶ added in v0.0.35
type StrT struct {
// contains filtered or unexported fields
}
func (StrT) Description ¶ added in v0.0.35
func (m StrT) Description() string
func (StrT) Documentation ¶ added in v0.0.35
func (m StrT) Documentation() string
func (*StrT) FromString ¶ added in v0.0.35
type UinT ¶ added in v0.0.35
type UinT struct {
// contains filtered or unexported fields
}
func (UinT) Description ¶ added in v0.0.35
func (m UinT) Description() string
func (UinT) Documentation ¶ added in v0.0.35
func (m UinT) Documentation() string