| // Copyright 2021 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include <lib/async-loop/cpp/loop.h> |
| #include <lib/async-loop/default.h> |
| #include <lib/sys/cpp/component_context.h> |
| #include <lib/syslog/cpp/macros.h> |
| |
| #include "src/lib/fxl/command_line.h" |
| #include "src/lib/fxl/log_settings_command_line.h" |
| #include "src/lib/intl/time_zone_info/time_zone_info_service.h" |
| |
| int main(int argc, const char** argv) { |
| auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); |
| if (!fxl::SetLogSettingsFromCommandLine(command_line)) { |
| return 1; |
| } |
| FX_LOGS(INFO) << "Starting TimeZoneInfoService"; |
| |
| async::Loop loop(&kAsyncLoopConfigAttachToCurrentThread); |
| auto context = sys::ComponentContext::CreateAndServeOutgoingDirectory(); |
| auto tz_svc = intl::TimeZoneInfoService::Create(); |
| // Starts serving `fuchsia.intl.TimeZones` |
| context->outgoing()->AddPublicService(tz_svc->GetHandler()); |
| tz_svc->Start(); |
| loop.Run(); |
| } |