# Pretty print Slices · gitcafe/zig

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

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

Visibility: public

Requested revision: 1d97747665b993eb0c625c8d0a28e2d0c8e167a3

Requested commit: 1d97747665b993eb0c625c8d0a28e2d0c8e167a3

Commit: 1d97747665b993eb0c625c8d0a28e2d0c8e167a3

Tree: 39704246d55eb124bf02b80a7df696f962bce22c

Author: ryuukk

Committer: Andrew Kelley

## Message

````
Pretty print Slices

This code is adapted from pixelherodev paste from IRC

I have added a new fmt option to handle printing slice values ``{v}`` or ``{V}``

While i think it can be made the default, i want your opinion about it

```zig
    var slicea = [0]u32{};
    var sliceb = [3]u32{ 1, 2, 3 };

    std.log.info("Content: {v}", .{slicea});
    std.log.info("Content: {v}", .{sliceb});
```

will print:

```
info: Content: []
info: Content: [1, 2, 3]
```

Question:

Should we drop ``{v}`` and make it the default behavior?

````

## Parents

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

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