The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Message.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#include "Messages.h"
12
13#include <format>
14
15namespace gp = Gaudi::Parsers;
16
17void gp::Messages::AddMessage( MSG::Level level, std::string_view message ) { stream_ << level << message << endmsg; }
18
19void gp::Messages::AddMessage( MSG::Level level, const Position& pos, std::string_view message ) {
20 if ( pos.filename() != m_currentFilename ) {
21 stream_ << level << "# =======> " << pos.filename() << endmsg;
23 }
24 stream_ << level << std::format( "# ({},{}): {}", pos.line(), pos.column(), message ) << endmsg;
25}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
std::string m_currentFilename
Name of last printed filename.
Definition Messages.h:44
void AddMessage(MSG::Level level, std::string_view message)
Definition Message.cpp:17
const std::string & filename() const
Definition Position.h:22
unsigned line() const
Definition Position.h:23
unsigned column() const
Definition Position.h:24