Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 1.72 KB

LOG.md

File metadata and controls

43 lines (25 loc) · 1.72 KB

What is a Log?

A log is a record that contains information about an application's runtime. Logs are useful for the development and debugging of a program.

For more information, read Logging (Software).

What is an Unstructured Log?

An unstructured log — in Software Development — is a log (record) without structure. For example, the Go standard library log implements unstructured logging.

log.Println("This creates an unstructured log.")
2009/11/10 23:00:00 This creates an unstructured log.

What is a Structured Log?

A structured log — in Software Development — is a log (record) with a specified structure (i.e CBOR, JSON). This allows developers to programmatically analyze and process logs.

{"time":1516134303,"level":"info","message":"This is a structured log in the JSON format."}

Disgo Logger

Disgo uses rs/zerolog to provide customizable zero-allocation structured logging.

Usage

Disgo provides leveled logging of the API Wrapper via the Logger global variable. As a result, this variable is accessible via disgo.Logger.

Disgo disables logs by default. Enable them using zerolog.SetGlobalLevel(zerolog.LEVEL).

For more information on the usage of zerolog.Logger, check out its features.

Configuration

Disgo imports the zerolog module, letting you use it in your program. As a result, the zerolog package can be configured from your application.

For more information on the configuration of zerolog, check out its Global Settings.