logging

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

logging

semantic-release Release license release Go Report Card

This project is in alpha state. It can AND will continue breaking until version 1.0.0 is released

What Is It

TBD

Supported Go Versions

Version Supported
<1.11 ❌
1.11 ✅
1.12 ✅
1.13 ✅
1.14 ✅

License

The full functionality of this library is and stays open source and free to use for everyone. Visit our website and get in touch.

See the exact licensing terms here

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFormatter

func SetFormatter(formatter logrus.Formatter)

func SetGlobal

func SetGlobal()

func SetIDKey

func SetIDKey(key string)

SetIDKey key of id in logentry

func SetLevel

func SetLevel(level logrus.Level)

func SetOutput

func SetOutput(out io.Writer)

func SetReportCaller

func SetReportCaller(include bool)

Types

type Config added in v0.0.1

type Config struct {
	Level       string    `json:"level"`
	Formatter   formatter `json:"formatter"`
	LocalLogger bool      `json:"localLogger"`
	LogCaller   bool      `json:"logCaller"`
}

func (*Config) UnmarshalJSON added in v0.0.2

func (c *Config) UnmarshalJSON(data []byte) error

func (*Config) UnmarshalYAML added in v0.0.2

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

type Entry

type Entry struct {
	*logrus.Entry
	// contains filtered or unexported fields
}

func Log

func Log(id string) *Entry

Log creates a new entry with an id

func LogWithFields

func LogWithFields(id string, fields ...interface{}) *Entry

LogWithFields creates a new entry with an id and the given fields

func (*Entry) Debug

func (e *Entry) Debug(args ...interface{})

func (*Entry) Debugf

func (e *Entry) Debugf(format string, args ...interface{})

func (*Entry) Debugln

func (e *Entry) Debugln(args ...interface{})

func (*Entry) Error

func (e *Entry) Error(args ...interface{})

func (*Entry) Errorf

func (e *Entry) Errorf(format string, args ...interface{})

func (*Entry) Errorln

func (e *Entry) Errorln(args ...interface{})

func (*Entry) Fatal

func (e *Entry) Fatal(args ...interface{})

func (*Entry) Fatalf

func (e *Entry) Fatalf(format string, args ...interface{})

func (*Entry) Fatalln

func (e *Entry) Fatalln(args ...interface{})

func (*Entry) Info

func (e *Entry) Info(args ...interface{})

func (*Entry) Infof

func (e *Entry) Infof(format string, args ...interface{})

func (*Entry) Infoln

func (e *Entry) Infoln(args ...interface{})

func (*Entry) Log

func (e *Entry) Log(level logrus.Level, args ...interface{})

func (*Entry) Logf

func (e *Entry) Logf(level logrus.Level, format string, args ...interface{})

func (*Entry) Logln

func (e *Entry) Logln(level logrus.Level, args ...interface{})

func (*Entry) OnError

func (e *Entry) OnError(err error) *Entry

OnError sets the error. The log will only be printed if err is not nil

func (*Entry) Panic

func (e *Entry) Panic(args ...interface{})

func (*Entry) Panicf

func (e *Entry) Panicf(format string, args ...interface{})

func (*Entry) Panicln

func (e *Entry) Panicln(args ...interface{})

func (*Entry) SetFields

func (e *Entry) SetFields(fields ...interface{}) *Entry

SetFields sets the given fields on the entry. It panics if length of fields is odd

func (*Entry) Trace

func (e *Entry) Trace(args ...interface{})

func (*Entry) Tracef

func (e *Entry) Tracef(format string, args ...interface{})

func (*Entry) Traceln

func (e *Entry) Traceln(args ...interface{})

func (*Entry) Warn

func (e *Entry) Warn(args ...interface{})

func (*Entry) Warnf

func (e *Entry) Warnf(format string, args ...interface{})

func (*Entry) Warning

func (e *Entry) Warning(args ...interface{})

func (*Entry) Warningf

func (e *Entry) Warningf(format string, args ...interface{})

func (*Entry) Warningln

func (e *Entry) Warningln(args ...interface{})

func (*Entry) Warnln

func (e *Entry) Warnln(args ...interface{})

func (*Entry) WithError

func (e *Entry) WithError(err error) *Entry

func (*Entry) WithField

func (e *Entry) WithField(key string, value interface{}) *Entry

func (*Entry) WithFields

func (e *Entry) WithFields(fields logrus.Fields) *Entry

func (*Entry) WithTime

func (e *Entry) WithTime(t time.Time) *Entry

Jump to

Keyboard shortcuts

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