LogSetupInformation in CreateInstance is too invasive
I think the LogSetupInformation was too invasive in Logger::CreateInstance()
. For instance, just printing the help of an otbcli application, you get those 3 lines of logs just before the list of parameters (plus, they are useless here since no processing is done). I moved it to 2 locations:
- in the TestMain, just before launching the test
- in
otb::Wrapper::Application
, at the start ofExecuteAndWriteOutput()
(and it allows also to use the application own logger directly instead of the singleton).
Feel free to suggest other relevant places.
Merge request reports
Activity
Since you are in the logger... Would it be possible to correct a typo?
Modules/Core/Streaming/include/otbStreamingManager.txx
:line 144 :
"<<availableRAMInBytes * otb::PipelineMemoryPrintCalculator::ByteToMegabyte<<" NB)[...]
Not NB but MB I guess.(I think I can manage to make the commit if I am allow to!!)
added refactoring label
Well, I was looking for a way to have those information always displayed ... But I agree that it might be confusing when you only want the app. documentation.
The only issue with your proposed solution is that those information will only show up when executing an app or a test, not in a regular otb main. Maybe we can move it to the beginning of writer / virtual writer call, with a boolean flag to ensure it is displayed only once ?
+1 to fix the typo btw.
added 1 commit
- 2749c2a8 - ENH: additional calls to LogSetupInformation, and a boolean guardian
@jmichel: I see your point, I added a few changes.
- Resolved by Julien Michel
- Resolved by Julien Michel
added 38 commits
-
2749c2a8...468110af - 37 commits from branch
develop
- 0fe51f0a - MRG: Synchronize with branch develop
-
2749c2a8...468110af - 37 commits from branch
added 40 commits
-
0fe51f0a...01a00be6 - 39 commits from branch
develop
- 9e9b0e79 - MRG: Synchronize with branch develop
-
0fe51f0a...01a00be6 - 39 commits from branch
mentioned in commit a3a5c936
With a recent version of develop (after merge of this MR), when running a composite application, I have :
$ ~/dev/build/otb/bin/otbcli_LargeScaleConnectedComponent -in image.tif -expr "distance < 50" -out cc.sqlite -fusion 1 -minsize 50 2018-04-13 17:30:44 (INFO): Default RAM limit for OTB is 128 MB 2018-04-13 17:30:44 (INFO): GDAL maximum cache size is 190 MB 2018-04-13 17:30:44 (INFO): OTB will use at most 4 threads 2018-04-13 17:30:44 (INFO): Default RAM limit for OTB is 128 MB 2018-04-13 17:30:44 (INFO): GDAL maximum cache size is 190 MB 2018-04-13 17:30:44 (INFO): OTB will use at most 4 threads 2018-04-13 17:30:44 (INFO): Loading kwl metadata from attached geom file image.geom 2018-04-13 17:31:00 (INFO): Elapsed: 15.923 seconds. 2018-04-13 17:31:00 (INFO): Estimated memory for full processing: 286.064MB (avail.: 128 MB), optimal image partitioning: 3 blocks 2018-04-13 17:31:00 (INFO): File cc.sqlite_labelmap.tif will be written in 4 blocks of 5000x1251 pixels Writing cc.sqlite_labelmap.tif...: 24% [************ ]2018-04-13 17:31:00 (WARNING): Skipping GCPs saving to prevent GDAL from assigning a WGS84 projref to file (cc.sqlite_labelmap.tif) Writing cc.sqlite_labelmap.tif...: 100% [**************************************************] (1 seconds) 2018-04-13 17:31:02 (INFO): Default RAM limit for OTB is 128 MB 2018-04-13 17:31:02 (INFO): GDAL maximum cache size is 190 MB 2018-04-13 17:31:02 (INFO): OTB will use at most 4 threads 2018-04-13 17:31:02 (INFO): Loading kwl metadata from attached geom file cc.sqlite_labelmap.geom 2018-04-13 17:31:02 (INFO): Estimated memory for full processing: 286.064MB (avail.: 128 MB), optimal image partitioning: 3 blocks 2018-04-13 17:31:02 (INFO): Estimation will be performed in 4 blocks of 5000x1251 pixels Retrieve region count...: 100% [**************************************************] (0 seconds) 2018-04-13 17:31:03 (INFO): Number of tiles: 10 x 10 2018-04-13 17:31:03 (INFO): Sums calculation ... 2018-04-13 17:31:04 (INFO): Building LUT for small regions merging ...
The log messages appear several times ...
mentioned in issue #1561 (closed)