/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <folly/init/Init.h> #include <folly/logging/Init.h> #include <folly/logging/example/lib.h> #include <folly/logging/xlog.h> usingnamespaceexample; // Invoking code that uses XLOG() statements before main() is safe. // This will use default log settings defined by folly::initializeLoggerDB(). static ExampleObject staticInitialized("static"); // Configure folly to enable INFO+ messages, and everything else to // enable WARNING+. // // Set the default log handler to log asynchronously by default // (except log messages with level WARNING and above synchronously) FOLLY_INIT_LOGGING_CONFIG(…); int main(int argc, char* argv[]) { … }