Skip to content

Commit e10df01

Browse files
committed
global resource is const char*
1 parent 9829e44 commit e10df01

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/viam/sdk/log/logger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ std::ostream& operator<<(std::ostream& os, log_level lvl) {
6363
return os;
6464
}
6565

66-
std::string global_resource_name() {
66+
const char* global_resource_name() {
6767
return "Viam C++ SDK";
6868
}
6969

src/viam/sdk/log/logger.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ using LogSource = boost::log::sources::severity_channel_logger_mt<log_level>;
4848

4949
/// @brief Returns the "channel name" of general log messages not originating from resources.
5050
/// @ingroup Log
51-
std::string global_resource_name();
51+
const char* global_resource_name();
5252

5353
/// @class Logger logger.hpp "log/logger.hpp"
5454
/// @brief Manages the logging infrastructure in the SDDK.

src/viam/sdk/tests/test_log.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE(test_cout_logging) {
2424
redirect.release();
2525

2626
for (const std::string& s :
27-
{"log1"s, to_string(sdk::log_level::info), sdk::global_resource_name()}) {
27+
{"log1"s, to_string(sdk::log_level::info), std::string{sdk::global_resource_name()}}) {
2828
BOOST_CHECK(rec.find(s) != std::string::npos);
2929
}
3030
}

0 commit comments

Comments
 (0)