log

package
v1.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 4 Imported by: 2

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

Constants

This section is empty.

Variables

View Source
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
)
View Source
var (
	DebugPrefix string = "<7>[DEBUG]    "
	InfoPrefix  string = "<6>[INFO]     "
	WarnPrefix  string = "<4>[WARNING]  "
	ErrPrefix   string = "<3>[ERROR]    "
	CritPrefix  string = "<2>[CRITICAL] "
)

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 Init

func Init(lvl string, logdate bool)

func Loglevel

func Loglevel() string

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.

func Warn

func Warn(v ...interface{})

Prints to WARNING writer without string formatting; application continues. Used for logging important information, e.g. uncommon edge-cases or administration related information.

func Warnf

func Warnf(format string, v ...interface{})

Prints to WARNING writer with string formatting; application continues. Used for logging important information, e.g. uncommon edge-cases or administration related information.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL