logger

package
v0.0.0-...-c2e30b8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: NIST-PD-fallback Imports: 4 Imported by: 0

README

ndn-dpdk/core/logger

This package is a thin wrapper of Logrus, a structured logger for Go. C code in this project uses the zf_log library.

Loggers in both C and Go support log level configuration through environment variables. For log module "Foo", the initialization code first looks for "NDNDPDK_LOG_Foo" and, if not found, looks for the generic "NDNDPDK_LOG" environment variable. The value of this environment variable must be one of:

  • V: VERBOSE level (C only)
  • D: DEBUG level
  • I: INFO level (default)
  • W: WARNING level
  • E: ERROR level
  • F: FATAL level
  • N: disabled (in C), PANIC level (in Go)

To find all log module names in the codebase, execute:

git grep -E 'INIT_ZF_LOG|logger\.New'

Documentation

Overview

Package logger is a thin wrapper of logrus library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLevel

func GetLevel(pkg string) rune

GetLevel returns configured log level of a package as a letter.

func MakeFields

func MakeFields(args ...interface{}) logrus.Fields

MakeFields constructs logrus.Fields from a sequence of arguments. Arguments must appear in key-value pairs.

func New

func New(pkg string) logrus.FieldLogger

New creates a logger.

func NewWithPrefix

func NewWithPrefix(pkg, prefix string) logrus.FieldLogger

NewWithPrefix creates a logger with specified prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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