Documentation ¶
Overview ¶
Package gogger is a console logger designed for simplicity and great features at the same time!
Index ¶
- Constants
- Variables
- type GoggerLogger
- func (g *GoggerLogger) Error(message string) bool
- func (g *GoggerLogger) Errorf(message string, formatOptions ...interface{}) bool
- func (g *GoggerLogger) Fatal(message string) bool
- func (g *GoggerLogger) Fatalf(message string, formatOptions ...interface{}) bool
- func (g *GoggerLogger) Info(message string) bool
- func (g *GoggerLogger) Infof(message string, formatOptions ...interface{}) bool
- func (g *GoggerLogger) SetLevel(level int) error
- func (g *GoggerLogger) Verbose(message string) bool
- func (g *GoggerLogger) Verbosef(message string, formatOptions ...interface{}) bool
- func (g *GoggerLogger) Warn(message string) bool
- func (g *GoggerLogger) Warnf(message string, formatOptions ...interface{}) bool
Constants ¶
const ( // VerboseLevel represents the level at which Verbose logs can be displayed. VerboseLevel int = 0 // InfoLevel represents the level at which Info logs can be displayed. InfoLevel int = 1 // WarnLevel represents the level at which Warn logs can be displayed. WarnLevel int = 2 // ErrorLevel represents the level at which Error logs can be displayed. ErrorLevel int = 3 // FatalLevel represents the level at which Fatal logs can be displayed. FatalLevel int = 4 // UKDateTimeFormat represents the time in the UK standard format. UKDateTimeFormat string = "02-01-2006 15:04:05" // USDateTimeFormat represents the time in the US standard format. USDateTimeFormat string = "01-02-2006 15:04:05" )
Variables ¶
var ( // ProjectNameColor is the color used for the project name in logs. ProjectNameColor = color.FgGreen // LevelColors is a list of github.com/faith/color color values to use for each level LevelColors = [5]color.Attribute{color.FgMagenta, color.FgCyan, color.FgYellow, color.FgRed, color.FgRed} // LevelStrings represents the strings used in logs to represent that particular level. LevelStrings [5]string = [5]string{"verbose", "info ", "warn ", "error ", "fatal "} )
Functions ¶
This section is empty.
Types ¶
type GoggerLogger ¶
GoggerLogger is the logging handler used for printing messages to the console.
func New ¶
func New(projectName string, timeFormat string, colorful bool) GoggerLogger
New initialises a new GoggerLogger.
func (*GoggerLogger) Error ¶
func (g *GoggerLogger) Error(message string) bool
Error messages are used to represent an error that needs logging but was still handled.
func (*GoggerLogger) Errorf ¶
func (g *GoggerLogger) Errorf(message string, formatOptions ...interface{}) bool
Errorf is like Error but with Sprintf.
func (*GoggerLogger) Fatal ¶
func (g *GoggerLogger) Fatal(message string) bool
Fatal messages denote that something really bad happened and the program has shut down.
func (*GoggerLogger) Fatalf ¶
func (g *GoggerLogger) Fatalf(message string, formatOptions ...interface{}) bool
Fatalf is like Fatal but with Sprintf.
func (*GoggerLogger) Info ¶
func (g *GoggerLogger) Info(message string) bool
Info logs are at the default logging level and represent informative information without being too specific.
func (*GoggerLogger) Infof ¶
func (g *GoggerLogger) Infof(message string, formatOptions ...interface{}) bool
Infof is like Info but with Sprintf.
func (*GoggerLogger) SetLevel ¶
func (g *GoggerLogger) SetLevel(level int) error
SetLevel will change the current level of the GoggerLogger.
func (*GoggerLogger) Verbose ¶
func (g *GoggerLogger) Verbose(message string) bool
Verbose messages are at the lowest log level and represent very detailed information.
func (*GoggerLogger) Verbosef ¶
func (g *GoggerLogger) Verbosef(message string, formatOptions ...interface{}) bool
Verbosef is like Verbose but with Sprintf.
func (*GoggerLogger) Warn ¶
func (g *GoggerLogger) Warn(message string) bool
Warn messages at used to represent something bad happening without it being catastrophic.
func (*GoggerLogger) Warnf ¶
func (g *GoggerLogger) Warnf(message string, formatOptions ...interface{}) bool
Warnf is like Warn but with Sprintf.