|
3 | 3 | #include <amarula/dbus/connman/gclock.hpp> |
4 | 4 | #include <amarula/dbus/gdbus.hpp> |
5 | 5 | #include <amarula/dbus/gproxy.hpp> |
| 6 | +#include <amarula/log.hpp> |
6 | 7 | #include <ctime> |
7 | 8 | #include <iomanip> |
8 | 9 | #include <iostream> |
@@ -42,7 +43,7 @@ void ClockProperties::update(const gchar* key, GVariant* value) { |
42 | 43 | } else if (g_strcmp0(key, TIMESERVERSYNCED_STR) == 0U) { |
43 | 44 | time_server_synced_ = g_variant_get_boolean(value) == 1U; |
44 | 45 | } else { |
45 | | - std::cerr << "Unknown property for Clock: " << key << '\n'; |
| 46 | + LCM_LOG("Unknown property for Clock: " << key << '\n'); |
46 | 47 | } |
47 | 48 | } |
48 | 49 |
|
@@ -97,24 +98,25 @@ void Clock::setTimeServers(const std::vector<std::string>& servers, |
97 | 98 | } |
98 | 99 |
|
99 | 100 | void ClockProperties::print() const { |
100 | | - std::cout << "@@@@@@@@@@ ClockProperties: @@@@@@@@@@@@@@@\n"; |
101 | | - std::cout << TIME_STR << ": " << time_ << " ("; |
| 101 | + LCM_LOG("@@@@@@@@@@ ClockProperties: @@@@@@@@@@@@@@@\n"); |
| 102 | + LCM_LOG(TIME_STR << ": " << time_ << " ("); |
102 | 103 | const auto time_value = static_cast<std::time_t>(time_); |
103 | | - std::cout << std::put_time(std::localtime(&time_value), "%Y-%m-%d %H:%M:%S") |
104 | | - << ")\n"; |
105 | | - std::cout << TIMEUPDATES_STR << ": " |
106 | | - << TIME_UPDATE_MAP.toString(time_updates_) << '\n'; |
107 | | - std::cout << TIMEZONE_STR << ": " << timezone_ << '\n'; |
108 | | - std::cout << TIMEZONEUPDATES_STR << ": " |
109 | | - << TIME_ZONE_UPDATE_MAP.toString(timezone_updates_) << '\n'; |
110 | | - std::cout << TIMESERVERSYNCED_STR << ": " << std::boolalpha |
111 | | - << time_server_synced_ << '\n'; |
112 | | - std::cout << TIMESERVERS_STR << ": "; |
| 104 | + LCM_LOG(std::put_time(std::localtime(&time_value), "%Y-%m-%d %H:%M:%S") |
| 105 | + << ")\n"); |
| 106 | + LCM_LOG(TIMEUPDATES_STR << ": " << TIME_UPDATE_MAP.toString(time_updates_) |
| 107 | + << '\n'); |
| 108 | + LCM_LOG(TIMEZONE_STR << ": " << timezone_ << '\n'); |
| 109 | + LCM_LOG(TIMEZONEUPDATES_STR |
| 110 | + << ": " << TIME_ZONE_UPDATE_MAP.toString(timezone_updates_) |
| 111 | + << '\n'); |
| 112 | + LCM_LOG(TIMESERVERSYNCED_STR << ": " << std::boolalpha |
| 113 | + << time_server_synced_ << '\n'); |
| 114 | + LCM_LOG(TIMESERVERS_STR << ": "); |
113 | 115 | for (const auto& server : time_servers_) { |
114 | | - std::cout << server << ' '; |
| 116 | + LCM_LOG(server << ' '); |
115 | 117 | } |
116 | | - std::cout << '\n'; |
117 | | - std::cout << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"; |
| 118 | + LCM_LOG('\n'); |
| 119 | + LCM_LOG("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); |
118 | 120 | } |
119 | 121 |
|
120 | 122 | } // namespace Amarula::DBus::G::Connman |
0 commit comments