blob: 98f44351b0a5942e8519fb5da614b5303705ed0f [file] [log] [blame]
// Copyright 2019 The Chromium 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 "chromecast/external_mojo/external_service_support/process_setup.h"
#include <locale.h>
#include <signal.h>
#include "base/command_line.h"
#include "base/logging.h"
#include "build/build_config.h"
namespace chromecast {
namespace external_service_support {
void CommonProcessInitialization(int argc, char** argv) {
#if !defined(OS_ANDROID)
// Set C library locale to make sure CommandLine can parse argument values
// in the correct encoding.
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C");
#endif
base::CommandLine::Init(argc, argv);
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings);
CHECK_NE(SIG_ERR, signal(SIGPIPE, SIG_IGN));
}
} // namespace external_service_support
} // namespace chromecast