Skip to content

Commit b35fc10

Browse files
refactor(logging): init Builder location_ in constructor; add location tests
Initialize location_ in the Builder constructor instead of via a default member initializer (behavior-preserving). Add tests pinning the default location to the constructor site and the Location() override to the caller's file and line. Co-authored-by: Isaac
1 parent 2cb7357 commit b35fc10

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/iceberg/logging/logger.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ struct ICEBERG_EXPORT LogMessage {
8585
/// Location() (e.g. to forward a caller's std::source_location).
8686
class ICEBERG_EXPORT LogMessage::Builder {
8787
public:
88-
explicit Builder(LogLevel level) : level_(level), location_(std::source_location::current()) {}
88+
explicit Builder(LogLevel level)
89+
: level_(level), location_(std::source_location::current()) {}
8990

9091
/// \brief Set the already-formatted message text.
9192
Builder& Message(std::string message) {

0 commit comments

Comments
 (0)