InfluxCommunity / influxdb3-go

The go package that provides a simple and convenient way to interact with InfluxDB 3.
https://pkg.go.dev/github.com/InfluxCommunity/influxdb3-go
MIT License
21 stars 11 forks source link

feat: Added logging #74

Closed thulasirajkomminar closed 3 months ago

thulasirajkomminar commented 3 months ago

Closes #73

Proposed Changes

Briefly describe your proposed changes:

Added log package to solve issue https://github.com/InfluxCommunity/influxdb3-go/issues/73

Checklist

thulasirajkomminar commented 3 months ago

@bednar Thought about just adding a simple logger but then I wanted to follow the V2 standards :) . So I like this simple implementation so modified my commit. Should we add log level to ClientConfig or should we override the defaults like this on the user side influxdb3.ConfigureLogger(map[string]bool{"debug": false, "info": true, "warn": false, "error": true})

bednar commented 3 months ago

Should we add log level to ClientConfig or should we override the defaults like this on the user side influxdb3.ConfigureLogger(map[string]bool{"debug": false, "info": true, "warn": false, "error": true})

Good catch! 👍 You are right it should be a part of ClientConfig.

thulasirajkomminar commented 3 months ago

Should we add log level to ClientConfig or should we override the defaults like this on the user side influxdb3.ConfigureLogger(map[string]bool{"debug": false, "info": true, "warn": false, "error": true})

Good catch! 👍 You are right it should be a part of ClientConfig.

@bednar could you verify?

thulasirajkomminar commented 3 months ago

For simplify our codebase we can use default logger:

@bednar Could you have a look?

alespour commented 3 months ago

I think the PR needs to be rebased or main merged into it to use fixed CI and have workflow check pass.

Code coverage check will probably fail because code coverage will decrease as there is quite a few lines not covered by unit tests (#80), but that could be ignored for now...

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.54%. Comparing base (94c8385) to head (bad20af).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #74 +/- ## ========================================== - Coverage 83.09% 74.54% -8.56% ========================================== Files 12 12 Lines 994 994 ========================================== - Hits 826 741 -85 - Misses 138 228 +90 + Partials 30 25 -5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.