Replace std::cout with ALICEVISION_LOG_* in library code#2101
Open
Replace std::cout with ALICEVISION_LOG_* in library code#2101
Conversation
…t.cpp Agent-Logs-Url: https://github.com/alicevision/AliceVision/sessions/f56c5c52-95dd-4289-9a10-d4443661ec91 Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
…ConsoleProgressDisplay overload without std::ostream& Agent-Logs-Url: https://github.com/alicevision/AliceVision/sessions/95d15813-3179-46f8-92df-c264648e4500 Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
…; fix separator in colorHarmonize debug message Agent-Logs-Url: https://github.com/alicevision/AliceVision/sessions/95d15813-3179-46f8-92df-c264648e4500 Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
fabiencastan
March 27, 2026 22:01
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
std::coutwas scattered throughout library code instead of being confined tomain_*.cppentry points. This enforces the convention by routing all library-side output through the logging system.Description
std::coutshould only be used inmain_*.cppfiles. Library code must useALICEVISION_LOG_*macros so output respects log level filtering, goes through the centralized logging infrastructure, and doesn't pollute stdout unconditionally.Features list
createConsoleProgressDisplay(count, s1, s2, s3)overload (nostd::ostream&arg) inProgressDisplay.hpp/.cpp— defaults to stdout internally, so callers don't referencestd::cout, std::coutfrom all library-sidecreateConsoleProgressDisplaycalls (13 files)std::cout <<withALICEVISION_LOG_{INFO,DEBUG,ERROR}in 8 library files:precisionEvaluationToGt.hpp,colorHarmonizeEngineGlobal.cpp,LaguerreBACalibration.cpp,GlobalPositioning.cpp,lightingCalibration.cpp,kvld.cpp,normalIntegration.cpp,Matrix3x4.hpppauseProcess()fromcolorHarmonizeEngineGlobal.cpp(never called; usedstd::cout/std::cin)#include <iostream>from files where it was only needed forstd::coutImplementation remarks
The new
createConsoleProgressDisplayoverload centralizes thestd::coutreference insideProgressDisplay.cpp— the one legitimate non-mainlocation for it:Intentionally left unchanged:
aliceVision/hdr/QuadProg++.cpp— third-party MIT filealiceVision/system/Logger.hpp—ALICEVISION_COUTmacro is part of the public logger APIaliceVision/depthMap/cuda/host/LRUCache.hpp—std::coutappears only inside a/* */comment blockdependencies/— third-party code