On Fri, Oct 25, 2019 at 4:50 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote: > > Currently, the only way to change the logging output of libbpf is to > override the print function with libbpf_set_print(). This is somewhat > cumbersome if one just wants to change the logging level (e.g., to enable No, it's not. Having one way of doing things is good, proliferation of APIs is not a good thing. Either way you require application to write some additional code. Doing simple vprintf-based (or whatever application is using to print logs, which libbpf shouldn't care about!) function with single if is not hard and is not cumbersome. If you care about helping users to be less confused on how to do that, I think it would be a good idea to have some sort of libbpf-specific FAQ with code samples on how to achieve typical and common stuff, like this one. So please instead consider doing that. > debugging), so add another function that just adjusts the default output > printing by adjusting the filtering of messages. > > Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > --- > tools/lib/bpf/libbpf.c | 12 +++++++++++- > tools/lib/bpf/libbpf.h | 2 ++ > tools/lib/bpf/libbpf.map | 1 + > 3 files changed, 14 insertions(+), 1 deletion(-) > [...]