Skip to content

Commit

Permalink
Fixes for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwbrei committed Dec 14, 2024
1 parent 1cd40ad commit 8f6849e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/libraries/JANA/Compatibility/jerror.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

#pragma once

#define _DBG_ std::cerr<<__FILE__<<":"<<__LINE__<<" "
#define _DBG__ std::cerr<<__FILE__<<":"<<__LINE__<<std::endl

enum jerror_t{
NOERROR = 0,
UNKNOWN_ERROR = -1000,
Expand Down
10 changes: 8 additions & 2 deletions src/libraries/JANA/JLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ JLogMessage operator<<(const JLogger& logger, T&& t) {
return message;
}

inline JLogMessage operator<<(const JLogger& logger, std::ostream& (*manip)(std::ostream&)) {
JLogMessage message(logger, logger.level);
message << manip;
return message;
}


/// Macros

Expand All @@ -147,8 +153,8 @@ JLogMessage operator<<(const JLogger& logger, T&& t) {
extern JLogger jout;
extern JLogger jerr;
#define jendl std::endl
#define default_cout_logger jout;
#define default_cerr_logger jerr;
#define default_cout_logger jout
#define default_cerr_logger jerr
#define _DBG_ jerr<<__FILE__<<":"<<__LINE__<<" "
#define _DBG__ jerr<<__FILE__<<":"<<__LINE__<<std::endl

3 changes: 2 additions & 1 deletion src/programs/unit_tests/Utils/JLoggerTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ TEST_CASE("JLogMessage_StreamIntoLogger") {
JLogger logger {JLogger::Level::ERROR, &std::cout, "jana"};
logger.ShowGroup(true);
logger << "This is a test. x = " << 22 << std::endl;
logger << "This should be the next line" << std::endl << "And another" << std::endl << "And another";
logger << "This should be the next line" << std::endl << "And another" << std::endl;
logger << std::endl << "There should be a blank line above this";
}


Expand Down

0 comments on commit 8f6849e

Please sign in to comment.