2 * Copyright 2004-present Facebook, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 * This file contains function to help configure the logging library behavior
20 * during program start-up.
23 #include <folly/Range.h>
28 * Initialize the logging library.
30 * The input string will be parsed with parseLogConfig() and then applied to
31 * the main LoggerDB singleton.
33 * Before it is applied, the input configuration settings are first combined
34 * with some basic defaults on the root log category. The defaults set the
35 * root log level to WARN, and attach a log handler named "default" that writes
36 * messages to stderr. However, these base settings can be overridden if the
37 * input string specifies alternate settings for the root log category.
39 * Note that it is safe for code to use logging functions before calling
40 * initLogging(). However, messages logged before initLogging() is called will
41 * be ignored since no log handler objects have been defined.
43 void initLogging(folly::StringPiece configString = "");