# std.log: simplify to 4 distinct log levels · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/f7b090d7076a20a614bf20cac05e5e18c06ad18a)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: f7b090d7076a20a614bf20cac05e5e18c06ad18a

Requested commit: f7b090d7076a20a614bf20cac05e5e18c06ad18a

Commit: f7b090d7076a20a614bf20cac05e5e18c06ad18a

Tree: 72bb252c5352e48ea6d60914debdf5ccc1821dff

Author: Isaac Freund

Committer: Andrew Kelley

## Message

```
std.log: simplify to 4 distinct log levels

Over the last year of using std.log in practice, it has become clear to
me that having the current 8 distinct log levels does more harm than
good. It is too subjective which level a given message should have which
makes filtering based on log level weaker as not all messages will have
been assigned the log level one might expect.

Instead, more granular filtering should be achieved by leveraging the
logging scope feature. Filtering based on a combination of scope and log
level should be sufficiently powerful for all use-cases.

Note that the self hosted compiler has already limited itself to 4
distinct log levels for many months and implemented granular filtering
based on both log scope and level. This has worked very well in practice
while working on the self hosted compiler.

```

## Parents

- [6cf5305e47dd8382508f867b04067be615448b41](https://git.cafe/gitcafe/zig/commit/6cf5305e47dd8382508f867b04067be615448b41?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/f7b090d7076a20a614bf20cac05e5e18c06ad18a?format=markdown)
