Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#911 Fix NPE in LogCallback #940

Merged
merged 1 commit into from Feb 8, 2018
Merged

#911 Fix NPE in LogCallback #940

merged 1 commit into from Feb 8, 2018

Conversation

ghost
Copy link

@ghost ghost commented Feb 7, 2018

Attempt to fix #911

Root cause: ${project.build.directory} (target/) doesn't exist and because of this an exception is thrown when attempting to create the SharedPrintStream to target/postgres.log; the catch block tries to log to this SharedPrintStream which wasn't constructed

Solution: create the dirs leading to the log file before opening the stream

…r the specified log file.

Create the path leading to the file if missing.

Signed-off-by: Ion Savin <[email protected]>
@codecov
Copy link

codecov bot commented Feb 7, 2018

Codecov Report

Merging #940 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master     #940      +/-   ##
============================================
+ Coverage     51.57%   51.57%   +<.01%     
  Complexity     1232     1232              
============================================
  Files           144      144              
  Lines          7250     7251       +1     
  Branches        981      981              
============================================
+ Hits           3739     3740       +1     
  Misses         3195     3195              
  Partials        316      316
Impacted Files Coverage Δ Complexity Δ
...o/fabric8/maven/docker/log/DefaultLogCallback.java 82.22% <100%> (+0.4%) 11 <0> (ø) ⬇️
...io/fabric8/maven/docker/log/SharedPrintStream.java 100% <100%> (ø) 6 <0> (ø) ⬇️

Copy link
Collaborator

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

thanks !

lgtm

@rhuss rhuss merged commit 7ac52ef into fabric8io:master Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE when logging to file
2 participants