Documentation

Overview

    Package logger provides a simple log interface that you can wrap whatever logging library you use into.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func NopLogger

    func NopLogger(_ string)

      NopLogger is a Logger implementation that does nothing.

      Types

      type Logger

      type Logger func(msg string)

        Logger is a simple common ground to wrap whatever logging library the user prefers into.

        func StdLogger

        func StdLogger(logger *log.Logger) Logger

          StdLogger is a Logger implementation that wraps stdlib log package.

          If passed in logger is nil, it falls back to

          log.New(os.Stderr, "", log.LstdFlags)
          

          func (Logger) Log

          func (l Logger) Log(msg string)

            Log is the nil-safe way of using a Logger.

            If l is nil it does nothing. Otherwise it calls l.

            Source Files