Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

logging: Allow logger to use STDERR #1457

Merged
merged 1 commit into from
Nov 26, 2019

Conversation

doanac
Copy link
Collaborator

@doanac doanac commented Nov 21, 2019

This allows libaktualizr to log to STDERR if LOG_STDERR is defined
in the environment. A handy way this can be used is for something
like aktualizr-get:

LOG_STDERR=1 aktualizr-get ....

This allows you to understand what is logging (stderr's fd) and what
is the output (stdout's fd).

Signed-off-by: Andy Doan andy@foundries.io

This allows libaktualizr to log to STDERR if LOG_STDERR is defined
in the environment. A handy way this can be used is for something
like aktualizr-get:

 LOG_STDERR=1 aktualizr-get ....

This allows you to understand what is logging (stderr's fd) and what
is the output (stdout's fd).

Signed-off-by: Andy Doan <andy@foundries.io>
@codecov-io
Copy link

codecov-io commented Nov 21, 2019

Codecov Report

Merging #1457 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1457      +/-   ##
==========================================
+ Coverage   80.28%   80.36%   +0.08%     
==========================================
  Files         183      183              
  Lines       11010    11013       +3     
==========================================
+ Hits         8839     8851      +12     
+ Misses       2171     2162       -9
Impacted Files Coverage Δ
src/libaktualizr/logging/default_log_sink.cc 36.36% <100%> (+10.04%) ⬆️
src/aktualizr_info/main.cc 90.23% <0%> (-0.47%) ⬇️
src/libaktualizr/storage/sqlstorage.cc 77.01% <0%> (+0.22%) ⬆️
src/libaktualizr/storage/sql_utils.h 85.91% <0%> (+1.4%) ⬆️
src/libaktualizr/package_manager/ostreemanager.cc 79.24% <0%> (+1.5%) ⬆️
src/libaktualizr/storage/sqlstorage_base.cc 78.37% <0%> (+2.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e77f1e4...518ec50. Read the comment docs.

Copy link
Collaborator

@pattivacek pattivacek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @doanac we are expecting to review/redo our logging at some point down the line to make it more flexible and easier to integrate in other logging systems. When that happens, this logic may have to change, but we'll be interested in your input. And for now, I see no problem with this.

@pattivacek pattivacek merged commit 2d06138 into advancedtelematic:master Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants