# std.log: add scoped logging struct · gitcafe/zig

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

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

Visibility: public

Requested revision: 7db2c11537552250462a5f4ab162e5ef4183489c

Requested commit: 7db2c11537552250462a5f4ab162e5ef4183489c

Commit: 7db2c11537552250462a5f4ab162e5ef4183489c

Tree: 3ff706490e57f2b164d495e2d93c43213154dc32

Author: heidezomp

Committer: heidezomp

## Message

```
std.log: add scoped logging struct

 * Add a std.log.scoped function that returns a scoped logging struct
 * Add a std.log.default struct that logs using the .default scope

Implementation of daurnimator's proposal:
https://github.com/ziglang/zig/issues/5943#issuecomment-669043489

Note that I named the function "scoped" instead of "scope" so as not to
clash with the scope parameter that is used everywhere; this seemed a
better solution to me than renaming the scope parameter to "s" or
"log_scope" or the like.

```

## Parents

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

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