Documentation
¶
Index ¶
- type Layout
- func (l *Layout) Add(flags ...Layout) (Layout, error)
- func (l *Layout) All(flags ...Layout) bool
- func (l *Layout) Any(flags ...Layout) bool
- func (l *Layout) Contains(flag Layout) (bool, error)
- func (l *Layout) Delete(flags ...Layout) (Layout, error)
- func (l *Layout) FilePath() bool
- func (l *Layout) FullFilePath() bool
- func (l *Layout) FuncAddress() bool
- func (l *Layout) FuncName() bool
- func (l *Layout) IsSingle() bool
- func (l *Layout) IsValid() bool
- func (l *Layout) LineNumber() bool
- func (l *Layout) Set(flags ...Layout) (Layout, error)
- func (l *Layout) ShortFilePath() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layout ¶
type Layout uint8
Layout is the type of single flags of the the Layout.
const ( // FullFilePath flag adding in the log message the path to // the go-file where the logging method was called. FullFilePath Layout = 1 << iota // ShortFilePath flag adding in the log message the short path // to the go-file where the logging method was called. ShortFilePath // FuncName flag adding in the log message the function's name // where the logging method was called. FuncName // FuncAddress flag adding in the log message the function's address // where the logging method was called. FuncAddress // LineNumber flag adding in the log message the line number // of the go-file where the logging method was called. LineNumber // Default is the default format for the log message. Default = ShortFilePath | FuncName | LineNumber // None is an explicit "no layout fields" sentinel for an Output's Layouts. // A zero Layouts is treated as "use Default" for backward compatibility, so // None is the way to actually disable caller info; the logger then also // skips the (relatively expensive) stack-frame capture. It is a // configuration marker consumed by SetOutputs/EditOutputs and never stored, // so it is deliberately outside the valid single-flag range. None Layout = 1 << 6 )
func (*Layout) Add ¶
Add adds the specified flags ignores duplicates or flags that value already contains. Returns a new value if all is well or old value and an error if one or more invalid flags are specified.
func (*Layout) Contains ¶
Contains method returns true if value contains the specified flag. Returns false and an error if the value is invalid or an invalid flag is specified.
func (*Layout) Delete ¶
Delete deletes the specified flags ignores duplicates or flags that were not set. Returns a new value if all is well or old value and an error if one or more invalid flags are specified.
func (*Layout) FilePath ¶
FilePath returns true if value contains the FullPath or ShortPath flags. Returns false and an error if the value is invalid.
func (*Layout) FullFilePath ¶
FullFilePath returns true if value contains the FullPath flag.
func (*Layout) FuncAddress ¶
FuncAddress returns true if value contains the FuncAddress flag.
func (*Layout) IsSingle ¶
IsSingle returns true if value contains single of the available flag. The custom flags cannot be valid since they should not affect the formatting settings. The zero value is an invalid flag too.
func (*Layout) IsValid ¶
IsValid returns true if value contains zero, one or an unique sum of valid FormatFlag flags. The zero value is a valid value.
func (*Layout) LineNumber ¶
LineNumber returns true if value contains the LineNumber flag.
func (*Layout) Set ¶
Set sets the specified flags ignores duplicates. The flags that were set previously will be discarded. Returns a new value if all is well or old value and an error if one or more invalid flags are specified.
func (*Layout) ShortFilePath ¶
ShortFilePath returns true if value contains the ShortPath flag.