Skip to content

Remove unavoidable print of CV error#15111

Merged
alalek merged 2 commits intoopencv:3.4from
RealOrangeOne:patch-1
Aug 8, 2019
Merged

Remove unavoidable print of CV error#15111
alalek merged 2 commits intoopencv:3.4from
RealOrangeOne:patch-1

Conversation

@RealOrangeOne
Copy link
Copy Markdown
Contributor

This pullrequest changes

This PR removes a print which was impossible to hide. My use case is it's also printed in the Python bindings, and as brute-forcing the camera ids is the only reliable way to enumerate all cameras, it's annoying and noisy to print each time.

The return value covers whether the device exists. This might be better hidden behind a debug flag, but I couldn't work out how to do that nicely.

@alalek
Copy link
Copy Markdown
Member

alalek commented Jul 21, 2019

All fprintf() calls should be replaced with CV_LOG_ macros (perhaps CV_LOG_WARNING / CV_LOG_INFO).

This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@RealOrangeOne RealOrangeOne changed the base branch from master to 3.4 July 22, 2019 07:24
RealOrangeOne and others added 2 commits July 22, 2019 08:25
The return value covers whether the device exists.

This might be better hidden behind a debug flag, but I couldn't work out how to do that nicely.
@RealOrangeOne
Copy link
Copy Markdown
Contributor Author

@alalek implemented your suggestions. Although in hindsight, i'm not sure whether keeping the log message. It's really not one which should be handed by OpenCV, more by the downstream user.

I'm reasonably sure WARNING is the right level, but that's generally the default log level, so this likely won't actually solve my original issue!

@mshabunin
Copy link
Copy Markdown
Contributor

this likely won't actually solve my original issue!

The message becomes avoidable. Set environment variable OPENCV_LOG_LEVEL=ERROR or OPENCV_LOG_LEVEL=FATAL.

@mshabunin mshabunin self-assigned this Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants