ouster-lidar / ouster-sdk

Ouster, Inc. sample code
Other
468 stars 440 forks source link

Make logging configurable #523

Open themightyoarfish opened 1 year ago

themightyoarfish commented 1 year ago

Is your feature request related to a problem? Please describe.

Client class logs to stdout by default. The only way to configure this seems to be setting the output log file with init_logger(). This prevents the user from handling the log messages themselves, e.g. ingestion into the application's logging. There's also no trivial portable way to disable logging, so inevitably, something is getting spammed.

Describe the solution you'd like

Make use of spdlog to allow custom loggers.

Describe alternatives you've considered n/a

Targeted Platform (please complete the following information only if applicable, otherwise dot N/A):

kairenw commented 1 year ago

Hi @themightyoarfish,

Thanks for the suggestion. To make it a bit more clear, are you suggesting that we shift logging.h to include/ and exposre more ways to configure the sink for our logger from it?

themightyoarfish commented 1 year ago

Since spdlog is a dependency anyway, the intuitive way to handle this in my opinion would be to let the user inject their own logger so they can do with ouster logs whatever they wish.