Skip to content

Replace std::cout with ALICEVISION_LOG_* in library code#2101

Open
Copilot wants to merge 3 commits intodevelopfrom
copilot/remove-inappropriate-logging
Open

Replace std::cout with ALICEVISION_LOG_* in library code#2101
Copilot wants to merge 3 commits intodevelopfrom
copilot/remove-inappropriate-logging

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

std::cout was scattered throughout library code instead of being confined to main_*.cpp entry points. This enforces the convention by routing all library-side output through the logging system.

Description

std::cout should only be used in main_*.cpp files. Library code must use ALICEVISION_LOG_* macros so output respects log level filtering, goes through the centralized logging infrastructure, and doesn't pollute stdout unconditionally.

Features list

  • Add createConsoleProgressDisplay(count, s1, s2, s3) overload (no std::ostream& arg) in ProgressDisplay.hpp/.cpp — defaults to stdout internally, so callers don't reference std::cout
  • Remove , std::cout from all library-side createConsoleProgressDisplay calls (13 files)
  • Replace direct std::cout << with ALICEVISION_LOG_{INFO,DEBUG,ERROR} in 8 library files: precisionEvaluationToGt.hpp, colorHarmonizeEngineGlobal.cpp, LaguerreBACalibration.cpp, GlobalPositioning.cpp, lightingCalibration.cpp, kvld.cpp, normalIntegration.cpp, Matrix3x4.hpp
  • Remove dead pauseProcess() from colorHarmonizeEngineGlobal.cpp (never called; used std::cout/std::cin)
  • Drop #include <iostream> from files where it was only needed for std::cout

Implementation remarks

The new createConsoleProgressDisplay overload centralizes the std::cout reference inside ProgressDisplay.cpp — the one legitimate non-main location for it:

// New overload — library callers no longer mention std::cout
ProgressDisplay createConsoleProgressDisplay(unsigned long expectedCount,
                                             const std::string& s1 = "\n",
                                             const std::string& s2 = "",
                                             const std::string& s3 = "");

Intentionally left unchanged:

  • aliceVision/hdr/QuadProg++.cpp — third-party MIT file
  • aliceVision/system/Logger.hppALICEVISION_COUT macro is part of the public logger API
  • aliceVision/depthMap/cuda/host/LRUCache.hppstd::cout appears only inside a /* */ comment block
  • dependencies/ — third-party code

Copilot AI and others added 3 commits March 27, 2026 20:15
…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>
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.

2 participants