Skip to content

Commit

Permalink
Log URL rather than just host and port
Browse files Browse the repository at this point in the history
  • Loading branch information
garethsb committed Feb 23, 2024
1 parent b03157d commit be297a5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Development/nmos/node_behaviour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ namespace nmos

self_id = id_type.first;

slog::log<slog::severities::info>(gate, SLOG_FLF) << "Registering nmos-cpp node with the Registration API at: " << registration_client->base_uri().host() << ":" << registration_client->base_uri().port();
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Registering nmos-cpp node with the Registration API at: " << registration_client->base_uri().to_string();

auto token = cancellation_source.get_token();
request = details::request_registration(*registration_client, events.at(0), gate, token).then([&](pplx::task<void> finally)
Expand Down Expand Up @@ -908,7 +908,7 @@ namespace nmos
// "The first interaction with a new Registration API [after a server side or connectivity issue]
// should be a heartbeat to confirm whether whether the Node is still present in the registry"

slog::log<slog::severities::info>(gate, SLOG_FLF) << "Attempting registration heartbeats with the Registration API at: " << registration_client->base_uri().host() << ":" << registration_client->base_uri().port();
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Attempting registration heartbeats with the Registration API at: " << registration_client->base_uri().to_string();

node_registered = false;

Expand Down
8 changes: 7 additions & 1 deletion Development/nmos/node_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ namespace nmos
{
// Log the API addresses we'll be using

slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp node with its primary Node API at: " << nmos::get_host(node_model.settings) << ":" << nmos::fields::node_port(node_model.settings);
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp node with its primary Node API at: "
<< web::uri_builder()
.set_scheme(nmos::http_scheme(node_model.settings))
.set_host(nmos::get_host(node_model.settings))
.set_port(nmos::fields::node_port(node_model.settings))
.set_path(U("/x-nmos/node/") + nmos::make_api_version(*nmos::is04_versions::from_settings(node_model.settings).rbegin()))

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

‘nmos::is04_versions’ has not been declared

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: false)

‘nmos::is04_versions’ has not been declared

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-20.04: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: unicast, enable_authorization: true)

‘nmos::is04_versions’ has not been declared

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-20.04: build and test (install mdns: true, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

‘nmos::is04_versions’ has not been declared

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-20.04: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

‘nmos::is04_versions’ has not been declared

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / macos-11: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

no member named 'is04_versions' in namespace 'nmos'

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2022: build and test (install mdns: false, use conan: true, force cpprest asio: true, dns-sd mode: multicast, enable_authorization: false)

'is04_versions': is not a member of 'nmos'

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2022: build and test (install mdns: false, use conan: true, force cpprest asio: true, dns-sd mode: multicast, enable_authorization: false)

'is04_versions': the symbol to the left of a '::' must be a type

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2022: build and test (install mdns: false, use conan: true, force cpprest asio: true, dns-sd mode: multicast, enable_authorization: false)

'from_settings': is not a member of 'nmos'

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2022: build and test (install mdns: false, use conan: true, force cpprest asio: true, dns-sd mode: multicast, enable_authorization: false)

'from_settings': identifier not found

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2019: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

'is04_versions': is not a member of 'nmos'

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2019: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

'is04_versions': the symbol to the left of a '::' must be a type

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2019: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

'from_settings': is not a member of 'nmos'

Check failure on line 33 in Development/nmos/node_server.cpp

View workflow job for this annotation

GitHub Actions / windows-2019: build and test (install mdns: false, use conan: true, force cpprest asio: false, dns-sd mode: multicast, enable_authorization: true)

'from_settings': identifier not found
.to_string();

nmos::server node_server{ node_model };

Expand Down
24 changes: 21 additions & 3 deletions Development/nmos/registry_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,27 @@ namespace nmos
{
// Log the API addresses we'll be using

slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp registry with its primary Node API at: " << nmos::get_host(registry_model.settings) << ":" << nmos::fields::node_port(registry_model.settings);
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp registry with its primary Registration API at: " << nmos::get_host(registry_model.settings) << ":" << nmos::fields::registration_port(registry_model.settings);
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp registry with its primary Query API at: " << nmos::get_host(registry_model.settings) << ":" << nmos::fields::query_port(registry_model.settings);
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp registry with its primary Node API at: "
<< web::uri_builder()
.set_scheme(nmos::http_scheme(registry_model.settings))
.set_host(nmos::get_host(registry_model.settings))
.set_port(nmos::fields::node_port(registry_model.settings))
.set_path(U("/x-nmos/node/") + nmos::make_api_version(*nmos::is04_versions::from_settings(registry_model.settings).rbegin()))
.to_string();
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp registry with its primary Registration API at: "
<< web::uri_builder()
.set_scheme(nmos::http_scheme(registry_model.settings))
.set_host(nmos::get_host(registry_model.settings))
.set_port(nmos::fields::registration_port(registry_model.settings))
.set_path(U("/x-nmos/registration/") + nmos::make_api_version(*nmos::is04_versions::from_settings(registry_model.settings).rbegin()))
.to_string();
slog::log<slog::severities::info>(gate, SLOG_FLF) << "Configuring nmos-cpp registry with its primary Query API at: "
<< web::uri_builder()
.set_scheme(nmos::http_scheme(registry_model.settings))
.set_host(nmos::get_host(registry_model.settings))
.set_port(nmos::fields::query_port(registry_model.settings))
.set_path(U("/x-nmos/query/") + nmos::make_api_version(*nmos::is04_versions::from_settings(registry_model.settings).rbegin()))
.to_string();

nmos::server registry_server{ registry_model };

Expand Down

0 comments on commit be297a5

Please sign in to comment.