Commit Graph

12 Commits

Author SHA1 Message Date
Tamir Duberstein 2f8759cc62 Dial the lints to 100 2026-01-29 10:02:48 -05:00
Christian A. Jacobsen a98b638fa9 feat(log): add support for logging raw pointer types
* Requires the usage of `:p` display hint.
* Will, like stdlib, log with `0x` prefix.
2025-10-16 05:22:10 -04:00
Tamir Duberstein 2d782606fe *: avoid Result::is_{ok,err}
These methods discard information. Discarding information is bad.
2025-03-03 11:28:34 -05:00
Tamir Duberstein 41706d74e4 Narrow clippy allowances 2024-12-27 09:47:39 -05:00
Tamir Duberstein 1bf6a38619 Simplify parse_param 2024-12-27 09:47:39 -05:00
Michal Rostecki 4f0559f2af chore: Fix cippy errors 2024-12-27 14:34:40 +01:00
lyuts 8e485bc77a aya-log-parser: add support of :p format 2023-11-19 11:30:04 +11:00
Tamir Duberstein 6d06e2bf3a Include ~all crates in default members
Several tests were not running due to being omitted from this list.
2023-07-14 11:05:10 -04:00
Michal Rostecki 84e5e2894f aya-log: Unify IP format hints into one, repsesent it by :i token
Having separate format hints and tokens per IP address family is
unnecessary, since they are represented by different types and we handle
format hints for each type separately. So we can just have one format
hint.

Also, we should be consistent with the format strings grammar in
Rust[0]. The `type` token, which is mapped to formatting traits, usually
consists of one letter[1] (and optional `?` for `Debug` trait, but that
doesn't matter for us). It shouldn't consist of multiple letters. Our
`:ipv4` and `:ipv6` tokens were clearly breaking that convention, so we
should rather switch to something with one letter - hence `:i`.

[0] https://doc.rust-lang.org/std/fmt/#syntax
[1] https://doc.rust-lang.org/std/fmt/#formatting-traits
2023-05-27 11:38:19 +07:00
Dmitry Savintsev 055d94f58b fix uninlined_format_args clippy issues 2022-12-05 17:03:26 +01:00
Michal Rostecki 2223ab828d aya-log: Add format hints for MAC addresses
Add `{:mac}` (for lower-case hex representation) and `{:MAC}` (for
upper-case hex representation) format hints for the `[u8; 6]` type,
which is the standard one in Linux to store physical addresses in.

Tested with: https://github.com/vadorovsky/aya-examples/tree/main/xdp-mac

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2022-11-07 10:17:35 -08:00
Michal Rostecki 83ec27f06b lib: Add display hints
This change adds optional display hints:

* `{:x}`, `{:X}` - for hex representation of numbers
* `{:ipv4}`, `{:IPv4}` - for IPv4 addresses
* `{:ipv6}`, `{:IPv6}` - for IPv6 addresses

It also gets rid of dyn-fmt and instead comes with our own parser
implementation.

Tested on: https://github.com/vadorovsky/aya-examples/tree/main/tc

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2022-08-29 14:35:07 +01:00