Skip to content

Commit e81d6bb

Browse files
authored
fix: replace std::cout with std::cerr in the error diagnostics handler (#644)
* Replace `std::cout` with `std::cerr` in the error diagnostics handler This is half of the solution for #643 and is more than workable in principle, but still without color. Regarding color, I noticed that "termcolor" is one of the additional project modules, so I'll see what that leads to. Finally, I'll review the current tests to see if any already exist that test the output flow and any coloration. If not, I'll try to implement such test(s). * Save benchmark test results * Delete benchmark test results
1 parent 3654654 commit e81d6bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/Ark/Error/Diagnostics.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ namespace Ark::Diagnostics
6464
*/
6565
std::string makeContextWithNode(const std::string& message, const internal::Node& node);
6666

67-
ARK_API void generateWithCode(const CodeError& e, const std::string& code, std::ostream& os = std::cout, bool colorize = true);
67+
ARK_API void generateWithCode(const CodeError& e, const std::string& code, std::ostream& os = std::cerr, bool colorize = true);
6868

6969
/**
70-
* @brief Generate a diagnostic from an error and print it to the standard output
70+
* @brief Generate a diagnostic from an error and print it to the standard error output
7171
*
7272
* @param e code error
7373
* @param os output stream
7474
* @param colorize generate colors or not
7575
*/
76-
ARK_API void generate(const CodeError& e, std::ostream& os = std::cout, bool colorize = true);
76+
ARK_API void generate(const CodeError& e, std::ostream& os = std::cerr, bool colorize = true);
7777
}
7878

7979
#endif // ARK_ERROR_DIAGNOSTICS_HPP

0 commit comments

Comments
 (0)