Skip to content

Commit f84f5ba

Browse files
JosephBorodachJosephBorodach
andauthored
Fix log timestamps to use utc_clock instead of local_clock (#617)
Co-authored-by: JosephBorodach <joseph.borodach@viam.com>
1 parent ded6cb8 commit f84f5ba

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/viam/sdk/log/logging.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ void LogManager::init_logging() {
151151
module_logger_.add_attribute("module_log_tag",
152152
boost::log::attributes::make_constant(module_tag{}));
153153

154-
boost::log::core::get()->add_global_attribute("TimeStamp",
155-
boost::log::attributes::local_clock());
154+
boost::log::core::get()->add_global_attribute("TimeStamp", boost::log::attributes::utc_clock());
156155

157156
const boost::log::formatter fmt =
158157
boost::log::expressions::stream

src/viam/sdk/log/logging.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ BOOST_LOG_ATTRIBUTE_KEYWORD_TYPE(attr_file, "file", boost::string_view);
161161
BOOST_LOG_ATTRIBUTE_KEYWORD_TYPE(attr_line, "line", unsigned int);
162162
BOOST_LOG_ATTRIBUTE_KEYWORD_TYPE(attr_time,
163163
"TimeStamp",
164-
boost::log::attributes::local_clock::value_type);
164+
boost::log::attributes::utc_clock::value_type);
165165

166166
} // namespace sdk
167167
} // namespace viam

0 commit comments

Comments
 (0)