Skip to content

Commit

Permalink
Temporary fix for the "big log full of color characters" bug (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Jun 19, 2019
1 parent e61ad3a commit 1e0584a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/wrench/logging/TerminalOutput.cpp
Expand Up @@ -10,6 +10,7 @@
#include <string>
#include <simgrid/s4u/Actor.hpp>
#include <iostream>
#include <xbt/log.h>
#include "wrench/logging/TerminalOutput.h"

namespace wrench {
Expand Down Expand Up @@ -42,6 +43,7 @@ namespace wrench {
* @brief Turn on colored output for the calling process
*/
void TerminalOutput::beginThisProcessColor() {

if ((not TerminalOutput::wrench_no_log) and (TerminalOutput::color_enabled)) {
std::cerr << TerminalOutput::getThisProcessLoggingColor();
}
Expand Down
12 changes: 8 additions & 4 deletions test/main.cpp
Expand Up @@ -9,10 +9,14 @@

#include <gtest/gtest.h>
#include <xbt.h>
#include <wrench/logging/TerminalOutput.h>

int main(int argc, char **argv) {
// disable log
xbt_log_control_set("root.thresh:critical");
// disable color for testing
wrench::TerminalOutput::disableColor();

// disable log
xbt_log_control_set("root.thresh:critical");


// Example selective log enabling
Expand All @@ -24,7 +28,7 @@ int main(int argc, char **argv) {
// xbt_log_control_set("simple_storage_service.thresh:info");
// xbt_log_control_set("multicore_compute_service.thresh:info");

::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();

}

0 comments on commit 1e0584a

Please sign in to comment.