cloudbase / wnbd

Windows Ceph RBD NBD driver
GNU Lesser General Public License v2.1
58 stars 26 forks source link

userspace: update logging #24

Closed petrutlucian94 closed 3 years ago

petrutlucian94 commented 3 years ago

userspace: update logging

We allow the library consumer to provide a logger function. This is really convenient because the consumer can choose how those messages will be handled (e.g. can use ETW or simple file logging, can format the messages, etc).

The main issue is that the logger is tied to the WNBD_DEVICE structure, which limits its usefulness since we can't use it in functions that don't accept this parameter.

This change will add a static logger function pointer, allowing the consumer to override it using a setter.

This commit also adds log messages to all the functions that couldn't use logging before.

Depends-On: https://github.com/cloudbase/wnbd/pull/23

aserdean commented 3 years ago

Acked-by: Alin Gabriel Serdean aserdean@cloudbasesolutions.com