Documentation
¶
Overview ¶
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- Variables
- func Abort(v ...interface{})
- func Abortf(format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Exit(v ...interface{})
- func Exitf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Init(lvl string, logdate bool)
- func Loglevel() string
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
var ( DebugWriter io.Writer = os.Stderr InfoWriter io.Writer = os.Stderr WarnWriter io.Writer = os.Stderr ErrWriter io.Writer = os.Stderr CritWriter io.Writer = os.Stderr )
var ( DebugPrefix string = "<7>[DEBUG] " InfoPrefix string = "<6>[INFO] " WarnPrefix string = "<4>[WARNING] " ErrPrefix string = "<3>[ERROR] " CritPrefix string = "<2>[CRITICAL] " )
var ( DebugLog *log.Logger = log.New(DebugWriter, DebugPrefix, log.LstdFlags) InfoLog *log.Logger = log.New(InfoWriter, InfoPrefix, log.LstdFlags|log.Lshortfile) WarnLog *log.Logger = log.New(WarnWriter, WarnPrefix, log.LstdFlags|log.Lshortfile) ErrLog *log.Logger = log.New(ErrWriter, ErrPrefix, log.LstdFlags|log.Llongfile) CritLog *log.Logger = log.New(CritWriter, CritPrefix, log.LstdFlags|log.Llongfile) )
Functions ¶
func Abort ¶ added in v1.4.4
func Abort(v ...interface{})
Prints to STDOUT without string formatting; application exits with error code 1. Used for terminating with message after to be expected errors, e.g. wrong arguments or during init().
func Abortf ¶ added in v1.4.4
func Abortf(format string, v ...interface{})
Prints to STDOUT with string formatting; application exits with error code 1. Used for terminating with message after to be expected errors, e.g. wrong arguments or during init().
func Debug ¶
func Debug(v ...interface{})
Prints to DEBUG writer without string formatting; application continues. Used for logging additional information, primarily for development.
func Debugf ¶
func Debugf(format string, v ...interface{})
Prints to DEBUG writer with string formatting; application continues. Used for logging additional information, primarily for development.
func Error ¶
func Error(v ...interface{})
Prints to ERROR writer without string formatting; application continues. Used for logging errors, but code still can return default(s) or nil.
func Errorf ¶
func Errorf(format string, v ...interface{})
Prints to ERROR writer with string formatting; application continues. Used for logging errors, but code still can return default(s) or nil.
func Exit ¶ added in v1.4.4
func Exit(v ...interface{})
Prints to STDOUT without string formatting; application exits with error code 0. Used for exiting succesfully with message after expected outcome, e.g. successful single-call application runs.
func Exitf ¶ added in v1.4.4
func Exitf(format string, v ...interface{})
Prints to STDOUT with string formatting; application exits with error code 0. Used for exiting succesfully with message after expected outcome, e.g. successful single-call application runs.
func Fatal ¶
func Fatal(v ...interface{})
Prints to CRITICAL writer without string formatting; application exits with error code 1. Used for terminating on unexpected errors with date and code location.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Prints to CRITICAL writer with string formatting; application exits with error code 1. Used for terminating on unexpected errors with date and code location.
func Info ¶
func Info(v ...interface{})
Prints to INFO writer without string formatting; application continues. Used for logging additional information, e.g. notable returns or common fail-cases.
func Infof ¶
func Infof(format string, v ...interface{})
Prints to INFO writer with string formatting; application continues. Used for logging additional information, e.g. notable returns or common fail-cases.
func Panic ¶
func Panic(v ...interface{})
Prints to PANIC function without string formatting; application exits with panic. Used for terminating on unexpected errors with stacktrace.
func Panicf ¶
func Panicf(format string, v ...interface{})
Prints to PANIC function with string formatting; application exits with panic. Used for terminating on unexpected errors with stacktrace.
func Print ¶
func Print(v ...interface{})
Prints to STDOUT without string formatting; application continues. Used for special cases not requiring log information like date or location.
func Printf ¶
func Printf(format string, v ...interface{})
Prints to STDOUT with string formatting; application continues. Used for special cases not requiring log information like date or location.
Types ¶
This section is empty.