Skip to content

Commit 01f00f8

Browse files
committed
ovis: make log verbosity and rendersystem configurable via environment
1 parent 6703cdd commit 01f00f8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/ovis/src/ovis.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <OgreCompositorManager.h>
1111

1212
#include <opencv2/calib3d.hpp>
13+
#include <opencv2/core/utils/configuration.private.hpp>
1314

1415
namespace cv
1516
{
@@ -183,6 +184,10 @@ struct Application : public OgreBites::ApplicationContext, public OgreBites::Inp
183184
: OgreBites::ApplicationContext("ovis", false), sceneMgr(NULL), title(_title), w(sz.width),
184185
h(sz.height), key_pressed(-1), flags(_flags)
185186
{
187+
if(utils::getConfigurationParameterBool("OPENCV_OVIS_VERBOSE_LOG", false))
188+
return;
189+
190+
// set default log with low log level
186191
logMgr.reset(new LogManager());
187192
logMgr->createLog("ovis.log", true, true, true);
188193
logMgr->setLogDetail(LL_LOW);
@@ -201,8 +206,9 @@ struct Application : public OgreBites::ApplicationContext, public OgreBites::Inp
201206

202207
bool oneTimeConfig() CV_OVERRIDE
203208
{
204-
Ogre::RenderSystem* rs = getRoot()->getRenderSystemByName(RENDERSYSTEM_NAME);
205-
CV_Assert(rs);
209+
Ogre::String rsname = utils::getConfigurationParameterString("OPENCV_OVIS_RENDERSYSTEM", RENDERSYSTEM_NAME);
210+
Ogre::RenderSystem* rs = getRoot()->getRenderSystemByName(rsname);
211+
CV_Assert(rs && "Could not find rendersystem");
206212
getRoot()->setRenderSystem(rs);
207213
return true;
208214
}

0 commit comments

Comments
 (0)