Commit f3bc89fd authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

move folly/experimental/logging to folly/logging/

Summary:
Promote the folly logging code out of the experimental subdirectory.
We have been using this for several months in a few projects and are pretty
happy with it so far.

After moving it out of the experimental/ subdirectory I plan to update
folly::Init() to automatically support configuring it via a `--logging` command
line flag (similar to the initialization it already does today for glog).

Reviewed By: yfeldblum, chadaustin

Differential Revision: D7755455

fbshipit-source-id: 052db34c97f7516728f7cbb1a5ad959def2f6efb
parent b9d5fd6e
...@@ -22,7 +22,7 @@ folly/**/test/*_test_using_jemalloc ...@@ -22,7 +22,7 @@ folly/**/test/*_test_using_jemalloc
folly/**/test/*.trs folly/**/test/*.trs
folly/config.* folly/config.*
folly/configure folly/configure
folly/experimental/logging/example/logging_example folly/logging/example/logging_example
folly/libfolly.pc folly/libfolly.pc
folly/m4/libtool.m4 folly/m4/libtool.m4
folly/m4/ltoptions.m4 folly/m4/ltoptions.m4
......
...@@ -104,8 +104,8 @@ REMOVE_MATCHES_FROM_LISTS(files hfiles ...@@ -104,8 +104,8 @@ REMOVE_MATCHES_FROM_LISTS(files hfiles
"^${FOLLY_DIR}/experimental/exception_tracer/" "^${FOLLY_DIR}/experimental/exception_tracer/"
"^${FOLLY_DIR}/experimental/hazptr/bench/" "^${FOLLY_DIR}/experimental/hazptr/bench/"
"^${FOLLY_DIR}/experimental/hazptr/example/" "^${FOLLY_DIR}/experimental/hazptr/example/"
"^${FOLLY_DIR}/experimental/logging/example/"
"^${FOLLY_DIR}/futures/exercises/" "^${FOLLY_DIR}/futures/exercises/"
"^${FOLLY_DIR}/logging/example/"
"^${FOLLY_DIR}/(.*/)?test/" "^${FOLLY_DIR}/(.*/)?test/"
"^${FOLLY_DIR}/tools/" "^${FOLLY_DIR}/tools/"
"Benchmark.cpp$" "Benchmark.cpp$"
...@@ -342,10 +342,10 @@ if (BUILD_TESTS) ...@@ -342,10 +342,10 @@ if (BUILD_TESTS)
${FOLLY_DIR}/test/SingletonTestStructs.cpp ${FOLLY_DIR}/test/SingletonTestStructs.cpp
${FOLLY_DIR}/test/SocketAddressTestHelper.cpp ${FOLLY_DIR}/test/SocketAddressTestHelper.cpp
${FOLLY_DIR}/test/SocketAddressTestHelper.h ${FOLLY_DIR}/test/SocketAddressTestHelper.h
${FOLLY_DIR}/experimental/logging/test/ConfigHelpers.cpp ${FOLLY_DIR}/logging/test/ConfigHelpers.cpp
${FOLLY_DIR}/experimental/logging/test/ConfigHelpers.h ${FOLLY_DIR}/logging/test/ConfigHelpers.h
${FOLLY_DIR}/experimental/logging/test/TestLogHandler.cpp ${FOLLY_DIR}/logging/test/TestLogHandler.cpp
${FOLLY_DIR}/experimental/logging/test/TestLogHandler.h ${FOLLY_DIR}/logging/test/TestLogHandler.h
${FOLLY_DIR}/futures/test/TestExecutor.cpp ${FOLLY_DIR}/futures/test/TestExecutor.cpp
${FOLLY_DIR}/futures/test/TestExecutor.h ${FOLLY_DIR}/futures/test/TestExecutor.h
${FOLLY_DIR}/io/async/test/BlockingSocket.h ${FOLLY_DIR}/io/async/test/BlockingSocket.h
...@@ -455,7 +455,7 @@ if (BUILD_TESTS) ...@@ -455,7 +455,7 @@ if (BUILD_TESTS)
#TEST async_io_test SOURCES AsyncIOTest.cpp #TEST async_io_test SOURCES AsyncIOTest.cpp
TEST fs_util_test SOURCES FsUtilTest.cpp TEST fs_util_test SOURCES FsUtilTest.cpp
DIRECTORY experimental/logging/test/ DIRECTORY logging/test/
TEST async_file_writer_test SOURCES AsyncFileWriterTest.cpp TEST async_file_writer_test SOURCES AsyncFileWriterTest.cpp
TEST config_parser_test SOURCES ConfigParserTest.cpp TEST config_parser_test SOURCES ConfigParserTest.cpp
TEST config_update_test SOURCES ConfigUpdateTest.cpp TEST config_update_test SOURCES ConfigUpdateTest.cpp
......
...@@ -5,7 +5,14 @@ endif ...@@ -5,7 +5,14 @@ endif
# Note that the order of SUBDIRS matters. # Note that the order of SUBDIRS matters.
# Many subdirectories depend on libfollytest from the test directory, # Many subdirectories depend on libfollytest from the test directory,
# so it must appear before other directories # so it must appear before other directories
SUBDIRS = . test experimental $(MAYBE_INIT) chrono/test io/test stats/test SUBDIRS = . \
test \
experimental \
$(MAYBE_INIT) \
chrono/test \
io/test \
logging \
stats/test
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
...@@ -165,34 +172,6 @@ nobase_follyinclude_HEADERS = \ ...@@ -165,34 +172,6 @@ nobase_follyinclude_HEADERS = \
experimental/JemallocNodumpAllocator.h \ experimental/JemallocNodumpAllocator.h \
experimental/JSONSchema.h \ experimental/JSONSchema.h \
experimental/LockFreeRingBuffer.h \ experimental/LockFreeRingBuffer.h \
experimental/logging/AsyncFileWriter.h \
experimental/logging/FileHandlerFactory.h \
experimental/logging/FileWriterFactory.h \
experimental/logging/GlogStyleFormatter.h \
experimental/logging/ImmediateFileWriter.h \
experimental/logging/Init.h \
experimental/logging/LogCategory.h \
experimental/logging/LogCategoryConfig.h \
experimental/logging/LogConfig.h \
experimental/logging/LogConfigParser.h \
experimental/logging/LogFormatter.h \
experimental/logging/Logger.h \
experimental/logging/LoggerDB.h \
experimental/logging/LogHandler.h \
experimental/logging/LogHandlerFactory.h \
experimental/logging/LogHandlerConfig.h \
experimental/logging/LogLevel.h \
experimental/logging/LogMessage.h \
experimental/logging/LogName.h \
experimental/logging/LogStream.h \
experimental/logging/LogStreamProcessor.h \
experimental/logging/LogWriter.h \
experimental/logging/printf.h \
experimental/logging/RateLimiter.h \
experimental/logging/StandardLogHandler.h \
experimental/logging/StandardLogHandlerFactory.h \
experimental/logging/StreamHandlerFactory.h \
experimental/logging/xlog.h \
experimental/NestedCommandLineApp.h \ experimental/NestedCommandLineApp.h \
experimental/observer/detail/Core.h \ experimental/observer/detail/Core.h \
experimental/observer/detail/GraphCycleDetector.h \ experimental/observer/detail/GraphCycleDetector.h \
...@@ -352,6 +331,34 @@ nobase_follyinclude_HEADERS = \ ...@@ -352,6 +331,34 @@ nobase_follyinclude_HEADERS = \
LockTraits.h \ LockTraits.h \
LockTraitsBoost.h \ LockTraitsBoost.h \
Logging.h \ Logging.h \
logging/AsyncFileWriter.h \
logging/FileHandlerFactory.h \
logging/FileWriterFactory.h \
logging/GlogStyleFormatter.h \
logging/ImmediateFileWriter.h \
logging/Init.h \
logging/LogCategory.h \
logging/LogCategoryConfig.h \
logging/LogConfig.h \
logging/LogConfigParser.h \
logging/LogFormatter.h \
logging/Logger.h \
logging/LoggerDB.h \
logging/LogHandler.h \
logging/LogHandlerFactory.h \
logging/LogHandlerConfig.h \
logging/LogLevel.h \
logging/LogMessage.h \
logging/LogName.h \
logging/LogStream.h \
logging/LogStreamProcessor.h \
logging/LogWriter.h \
logging/printf.h \
logging/RateLimiter.h \
logging/StandardLogHandler.h \
logging/StandardLogHandlerFactory.h \
logging/StreamHandlerFactory.h \
logging/xlog.h \
MacAddress.h \ MacAddress.h \
MapUtil.h \ MapUtil.h \
Math.h \ Math.h \
......
...@@ -662,10 +662,10 @@ AC_CONFIG_FILES([Makefile ...@@ -662,10 +662,10 @@ AC_CONFIG_FILES([Makefile
test/function_benchmark/Makefile test/function_benchmark/Makefile
experimental/Makefile experimental/Makefile
experimental/io/test/Makefile experimental/io/test/Makefile
experimental/logging/Makefile
experimental/logging/example/Makefile
experimental/symbolizer/Makefile experimental/symbolizer/Makefile
init/Makefile init/Makefile
logging/Makefile
logging/example/Makefile
stats/test/Makefile]) stats/test/Makefile])
AM_COND_IF([EXCEPTION_TRACER], AM_COND_IF([EXCEPTION_TRACER],
......
...@@ -4,4 +4,4 @@ endif ...@@ -4,4 +4,4 @@ endif
if EXCEPTION_TRACER if EXCEPTION_TRACER
MAYBE_EXCEPTION_TRACER = exception_tracer MAYBE_EXCEPTION_TRACER = exception_tracer
endif endif
SUBDIRS = io/test logging $(MAYBE_SYMBOLIZER) $(MAYBE_EXCEPTION_TRACER) SUBDIRS = io/test $(MAYBE_SYMBOLIZER) $(MAYBE_EXCEPTION_TRACER)
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/AsyncFileWriter.h> #include <folly/logging/AsyncFileWriter.h>
#include <folly/Exception.h> #include <folly/Exception.h>
#include <folly/FileUtil.h> #include <folly/FileUtil.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <folly/system/ThreadName.h> #include <folly/system/ThreadName.h>
using folly::File; using folly::File;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <folly/File.h> #include <folly/File.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
#include <folly/experimental/logging/LogWriter.h> #include <folly/logging/LogWriter.h>
namespace folly { namespace folly {
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/FileHandlerFactory.h> #include <folly/logging/FileHandlerFactory.h>
#include <folly/experimental/logging/FileWriterFactory.h> #include <folly/logging/FileWriterFactory.h>
#include <folly/experimental/logging/StandardLogHandler.h> #include <folly/logging/StandardLogHandler.h>
#include <folly/experimental/logging/StandardLogHandlerFactory.h> #include <folly/logging/StandardLogHandlerFactory.h>
namespace folly { namespace folly {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#pragma once #pragma once
#include <folly/experimental/logging/LogHandlerFactory.h> #include <folly/logging/LogHandlerFactory.h>
namespace folly { namespace folly {
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/FileWriterFactory.h> #include <folly/logging/FileWriterFactory.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/File.h> #include <folly/File.h>
#include <folly/experimental/logging/AsyncFileWriter.h> #include <folly/logging/AsyncFileWriter.h>
#include <folly/experimental/logging/ImmediateFileWriter.h> #include <folly/logging/ImmediateFileWriter.h>
using std::make_shared; using std::make_shared;
using std::string; using std::string;
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/GlogStyleFormatter.h> #include <folly/logging/GlogStyleFormatter.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/portability/Time.h> #include <folly/portability/Time.h>
namespace { namespace {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/LogFormatter.h> #include <folly/logging/LogFormatter.h>
namespace folly { namespace folly {
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/ImmediateFileWriter.h> #include <folly/logging/ImmediateFileWriter.h>
#include <folly/FileUtil.h> #include <folly/FileUtil.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
using folly::StringPiece; using folly::StringPiece;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <folly/File.h> #include <folly/File.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/LogWriter.h> #include <folly/logging/LogWriter.h>
namespace folly { namespace folly {
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/Init.h> #include <folly/logging/Init.h>
#include <folly/experimental/logging/LogConfig.h> #include <folly/logging/LogConfig.h>
#include <folly/experimental/logging/LogConfigParser.h> #include <folly/logging/LogConfigParser.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <folly/experimental/logging/StreamHandlerFactory.h> #include <folly/logging/StreamHandlerFactory.h>
namespace folly { namespace folly {
......
...@@ -68,7 +68,7 @@ void initLoggingOrDie(folly::StringPiece configString = ""); ...@@ -68,7 +68,7 @@ void initLoggingOrDie(folly::StringPiece configString = "");
* additional settings, and it may also override settings for categories and * additional settings, and it may also override settings for categories and
* handlers defined in the base configuration. * handlers defined in the base configuration.
* *
* See folly/experimental/logging/example/main.cpp for an example that defines * See folly/logging/example/main.cpp for an example that defines
* getBaseLoggingConfig(). * getBaseLoggingConfig().
* *
* If this function returns a non-null pointer, it should point to a * If this function returns a non-null pointer, it should point to a
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
#include <folly/ExceptionString.h> #include <folly/ExceptionString.h>
#include <folly/FileUtil.h> #include <folly/FileUtil.h>
#include <folly/MapUtil.h> #include <folly/MapUtil.h>
#include <folly/experimental/logging/LogHandler.h> #include <folly/logging/LogHandler.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/experimental/logging/LogName.h> #include <folly/logging/LogName.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
namespace folly { namespace folly {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
namespace folly { namespace folly {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogCategoryConfig.h> #include <folly/logging/LogCategoryConfig.h>
namespace folly { namespace folly {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <vector> #include <vector>
#include <folly/Optional.h> #include <folly/Optional.h>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
namespace folly { namespace folly {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogConfig.h> #include <folly/logging/LogConfig.h>
#include <folly/Conv.h> #include <folly/Conv.h>
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <folly/experimental/logging/LogCategoryConfig.h> #include <folly/logging/LogCategoryConfig.h>
#include <folly/experimental/logging/LogHandlerConfig.h> #include <folly/logging/LogHandlerConfig.h>
namespace folly { namespace folly {
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogConfigParser.h> #include <folly/logging/LogConfigParser.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <folly/experimental/logging/LogName.h>
#include <folly/json.h> #include <folly/json.h>
#include <folly/lang/SafeAssert.h> #include <folly/lang/SafeAssert.h>
#include <folly/logging/LogName.h>
using std::shared_ptr; using std::shared_ptr;
using std::string; using std::string;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <folly/CPortability.h> #include <folly/CPortability.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/LogConfig.h> #include <folly/logging/LogConfig.h>
/* /*
* This file contains utility functions for parsing and serializing * This file contains utility functions for parsing and serializing
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <atomic> #include <atomic>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
namespace folly { namespace folly {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogHandlerConfig.h> #include <folly/logging/LogHandlerConfig.h>
#include <folly/lang/SafeAssert.h> #include <folly/lang/SafeAssert.h>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
#include <array> #include <array>
#include <cctype> #include <cctype>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/system/ThreadId.h> #include <folly/system/ThreadId.h>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <string> #include <string>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
namespace folly { namespace folly {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogName.h> #include <folly/logging/LogName.h>
namespace { namespace {
constexpr bool isSeparator(char c) { constexpr bool isSeparator(char c) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogStream.h> #include <folly/logging/LogStream.h>
namespace folly { namespace folly {
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include <ostream> #include <ostream>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
namespace folly { namespace folly {
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogStreamProcessor.h> #include <folly/logging/LogStreamProcessor.h>
#include <folly/experimental/logging/LogStream.h> #include <folly/logging/LogStream.h>
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
namespace folly { namespace folly {
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#include <folly/Demangle.h> #include <folly/Demangle.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/experimental/logging/LogStream.h> #include <folly/logging/LogStream.h>
#include <cstdlib> #include <cstdlib>
namespace folly { namespace folly {
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/Logger.h> #include <folly/logging/Logger.h>
#include <ostream> #include <ostream>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
using std::string; using std::string;
......
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
#include <folly/experimental/logging/LogStream.h> #include <folly/logging/LogStream.h>
#include <folly/experimental/logging/LogStreamProcessor.h> #include <folly/logging/LogStreamProcessor.h>
/** /**
* Log a message to the specified logger. * Log a message to the specified logger.
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <set> #include <set>
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/FileUtil.h> #include <folly/FileUtil.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <folly/experimental/logging/LogConfig.h> #include <folly/logging/LogConfig.h>
#include <folly/experimental/logging/LogHandler.h> #include <folly/logging/LogHandler.h>
#include <folly/experimental/logging/LogHandlerFactory.h> #include <folly/logging/LogHandlerFactory.h>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
#include <folly/experimental/logging/Logger.h> #include <folly/logging/Logger.h>
#include <folly/experimental/logging/RateLimiter.h> #include <folly/logging/RateLimiter.h>
#include <folly/experimental/logging/StreamHandlerFactory.h> #include <folly/logging/StreamHandlerFactory.h>
using std::string; using std::string;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include <folly/experimental/logging/LogName.h> #include <folly/logging/LogName.h>
namespace folly { namespace folly {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/RateLimiter.h> #include <folly/logging/RateLimiter.h>
namespace folly { namespace folly {
namespace logging { namespace logging {
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/StandardLogHandler.h> #include <folly/logging/StandardLogHandler.h>
#include <folly/experimental/logging/LogFormatter.h> #include <folly/logging/LogFormatter.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/experimental/logging/LogWriter.h> #include <folly/logging/LogWriter.h>
namespace folly { namespace folly {
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include <folly/File.h> #include <folly/File.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/LogHandler.h> #include <folly/logging/LogHandler.h>
#include <folly/experimental/logging/LogHandlerConfig.h> #include <folly/logging/LogHandlerConfig.h>
namespace folly { namespace folly {
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/StandardLogHandlerFactory.h> #include <folly/logging/StandardLogHandlerFactory.h>
#include <folly/MapUtil.h> #include <folly/MapUtil.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/experimental/logging/GlogStyleFormatter.h> #include <folly/logging/GlogStyleFormatter.h>
#include <folly/experimental/logging/StandardLogHandler.h> #include <folly/logging/StandardLogHandler.h>
using std::string; using std::string;
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/StreamHandlerFactory.h> #include <folly/logging/StreamHandlerFactory.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/experimental/logging/FileWriterFactory.h> #include <folly/logging/FileWriterFactory.h>
#include <folly/experimental/logging/StandardLogHandler.h> #include <folly/logging/StandardLogHandler.h>
#include <folly/experimental/logging/StandardLogHandlerFactory.h> #include <folly/logging/StandardLogHandlerFactory.h>
namespace folly { namespace folly {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#pragma once #pragma once
#include <folly/experimental/logging/LogHandlerFactory.h> #include <folly/logging/LogHandlerFactory.h>
namespace folly { namespace folly {
......
...@@ -6,4 +6,4 @@ logging_example_LDADD = libfollylogging_example.la ...@@ -6,4 +6,4 @@ logging_example_LDADD = libfollylogging_example.la
libfollylogging_example_la_SOURCES = lib.cpp libfollylogging_example_la_SOURCES = lib.cpp
libfollylogging_example_la_LIBADD = \ libfollylogging_example_la_LIBADD = \
$(top_builddir)/experimental/logging/libfollylogging.la $(top_builddir)/logging/libfollylogging.la
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/example/lib.h> #include <folly/logging/example/lib.h>
namespace example { namespace example {
ExampleObject::~ExampleObject() { ExampleObject::~ExampleObject() {
// All XLOG() statements in this file will log to the category // All XLOG() statements in this file will log to the category
// folly.experimental.logging.example.lib // folly.logging.example.lib
XLOGF(DBG1, "ExampleObject({}) at {} destroyed", value_, this); XLOGF(DBG1, "ExampleObject({}) at {} destroyed", value_, this);
} }
} // namespace example } // namespace example
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
namespace example { namespace example {
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/Init.h>
#include <folly/experimental/logging/xlog.h>
#include <folly/init/Init.h> #include <folly/init/Init.h>
#include <folly/logging/Init.h>
#include <folly/logging/xlog.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/experimental/logging/example/lib.h> #include <folly/logging/example/lib.h>
DEFINE_string(logging, "", "Logging category configuration string"); DEFINE_string(logging, "", "Logging category configuration string");
...@@ -47,7 +47,7 @@ int main(int argc, char* argv[]) { ...@@ -47,7 +47,7 @@ int main(int argc, char* argv[]) {
folly::initLoggingOrDie(FLAGS_logging); folly::initLoggingOrDie(FLAGS_logging);
// All XLOG() statements in this file will log to the category // All XLOG() statements in this file will log to the category
// folly.experimental.logging.example.main // folly.logging.example.main
XLOG(INFO, "now the normal log settings have been applied"); XLOG(INFO, "now the normal log settings have been applied");
XLOG(DBG1, "log arguments are concatenated: ", 12345, ", ", 92.0); XLOG(DBG1, "log arguments are concatenated: ", 12345, ", ", 92.0);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/printf.h> #include <folly/logging/printf.h>
#include <cstdarg> #include <cstdarg>
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
* syntax. (The "F" suffix is used for folly:format()-style.) * syntax. (The "F" suffix is used for folly:format()-style.)
*/ */
#include <folly/experimental/logging/Logger.h> #include <folly/logging/Logger.h>
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
namespace folly { namespace folly {
std::string loggingFormatPrintf( std::string loggingFormatPrintf(
......
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
#include <folly/String.h> #include <folly/String.h>
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
#include <folly/experimental/TestUtil.h> #include <folly/experimental/TestUtil.h>
#include <folly/experimental/logging/AsyncFileWriter.h>
#include <folly/experimental/logging/Init.h>
#include <folly/experimental/logging/LoggerDB.h>
#include <folly/experimental/logging/xlog.h>
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/futures/Promise.h> #include <folly/futures/Promise.h>
#include <folly/init/Init.h> #include <folly/init/Init.h>
#include <folly/lang/SafeAssert.h> #include <folly/lang/SafeAssert.h>
#include <folly/logging/AsyncFileWriter.h>
#include <folly/logging/Init.h>
#include <folly/logging/LoggerDB.h>
#include <folly/logging/xlog.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/test/ConfigHelpers.h> #include <folly/logging/test/ConfigHelpers.h>
#include <ostream> #include <ostream>
#include <folly/String.h> #include <folly/String.h>
#include <folly/experimental/logging/LogConfig.h> #include <folly/logging/LogConfig.h>
#include <folly/experimental/logging/LogConfigParser.h> #include <folly/logging/LogConfigParser.h>
#include <folly/experimental/logging/LogHandler.h> #include <folly/logging/LogHandler.h>
namespace folly { namespace folly {
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
*/ */
#include <folly/String.h> #include <folly/String.h>
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <folly/experimental/logging/LogCategory.h>
#include <folly/experimental/logging/LogConfig.h>
#include <folly/experimental/logging/LogConfigParser.h>
#include <folly/experimental/logging/test/ConfigHelpers.h>
#include <folly/json.h> #include <folly/json.h>
#include <folly/logging/LogCategory.h>
#include <folly/logging/LogConfig.h>
#include <folly/logging/LogConfigParser.h>
#include <folly/logging/test/ConfigHelpers.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/TestUtils.h> #include <folly/test/TestUtils.h>
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <folly/experimental/logging/LogCategory.h>
#include <folly/experimental/logging/LogConfig.h>
#include <folly/experimental/logging/LogConfigParser.h>
#include <folly/experimental/logging/LogHandlerFactory.h>
#include <folly/experimental/logging/LoggerDB.h>
#include <folly/experimental/logging/test/ConfigHelpers.h>
#include <folly/experimental/logging/test/TestLogHandler.h>
#include <folly/json.h> #include <folly/json.h>
#include <folly/logging/LogCategory.h>
#include <folly/logging/LogConfig.h>
#include <folly/logging/LogConfigParser.h>
#include <folly/logging/LogHandlerFactory.h>
#include <folly/logging/LoggerDB.h>
#include <folly/logging/test/ConfigHelpers.h>
#include <folly/logging/test/TestLogHandler.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/TestUtils.h> #include <folly/test/TestUtils.h>
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/Init.h>
#include <folly/experimental/logging/xlog.h>
#include <folly/init/Init.h> #include <folly/init/Init.h>
#include <folly/logging/Init.h>
#include <folly/logging/xlog.h>
#include <folly/portability/Stdlib.h> #include <folly/portability/Stdlib.h>
DEFINE_string(logging, "", "Logging category configuration string"); DEFINE_string(logging, "", "Logging category configuration string");
......
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/FileHandlerFactory.h> #include <folly/logging/FileHandlerFactory.h>
#include <folly/experimental/logging/StreamHandlerFactory.h> #include <folly/logging/StreamHandlerFactory.h>
#include <folly/Exception.h> #include <folly/Exception.h>
#include <folly/experimental/TestUtil.h> #include <folly/experimental/TestUtil.h>
#include <folly/experimental/logging/AsyncFileWriter.h> #include <folly/logging/AsyncFileWriter.h>
#include <folly/experimental/logging/GlogStyleFormatter.h> #include <folly/logging/GlogStyleFormatter.h>
#include <folly/experimental/logging/ImmediateFileWriter.h> #include <folly/logging/ImmediateFileWriter.h>
#include <folly/experimental/logging/StandardLogHandler.h> #include <folly/logging/StandardLogHandler.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/TestUtils.h> #include <folly/test/TestUtils.h>
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
*/ */
#include <cstdlib> #include <cstdlib>
#include <folly/experimental/logging/GlogStyleFormatter.h>
#include <folly/experimental/logging/LogMessage.h>
#include <folly/experimental/logging/Logger.h>
#include <folly/experimental/logging/LoggerDB.h>
#include <folly/init/Init.h> #include <folly/init/Init.h>
#include <folly/logging/GlogStyleFormatter.h>
#include <folly/logging/LogMessage.h>
#include <folly/logging/Logger.h>
#include <folly/logging/LoggerDB.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/portability/Stdlib.h> #include <folly/portability/Stdlib.h>
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <folly/Exception.h> #include <folly/Exception.h>
#include <folly/FileUtil.h> #include <folly/FileUtil.h>
#include <folly/experimental/TestUtil.h> #include <folly/experimental/TestUtil.h>
#include <folly/experimental/logging/ImmediateFileWriter.h> #include <folly/logging/ImmediateFileWriter.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/Init.h> #include <folly/logging/Init.h>
#include <folly/experimental/logging/LogConfigParser.h> #include <folly/logging/LogConfigParser.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <folly/experimental/logging/test/ConfigHelpers.h> #include <folly/logging/test/ConfigHelpers.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/TestUtils.h> #include <folly/test/TestUtils.h>
......
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/logging/LogCategory.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/Logger.h>
#include <folly/experimental/logging/Logger.h> #include <folly/logging/LoggerDB.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/test/TestLogHandler.h>
#include <folly/experimental/logging/test/TestLogHandler.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/logging/LogLevel.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Random.h> #include <folly/Random.h>
#include <folly/experimental/logging/LogLevel.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/logging/LogMessage.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/Logger.h>
#include <folly/experimental/logging/Logger.h> #include <folly/logging/LoggerDB.h>
#include <folly/experimental/logging/LoggerDB.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogName.h> #include <folly/logging/LogName.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/LogStream.h> #include <folly/logging/LogStream.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -13,9 +13,10 @@ ...@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/Logger.h> #include <folly/logging/LoggerDB.h>
#include <folly/experimental/logging/LoggerDB.h>
#include <folly/experimental/logging/test/TestLogHandler.h> #include <folly/logging/Logger.h>
#include <folly/logging/test/TestLogHandler.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/Logger.h> #include <folly/logging/Logger.h>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <folly/experimental/logging/LogHandler.h> #include <folly/logging/LogHandler.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <folly/experimental/logging/test/TestLogHandler.h> #include <folly/logging/test/TestLogHandler.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/TestUtils.h> #include <folly/test/TestUtils.h>
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/printf.h> #include <folly/logging/printf.h>
#include <folly/experimental/logging/test/TestLogHandler.h> #include <folly/logging/test/TestLogHandler.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <thread> #include <thread>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/experimental/logging/RateLimiter.h> #include <folly/logging/RateLimiter.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using folly::logging::IntervalRateLimiter; using folly::logging::IntervalRateLimiter;
......
...@@ -13,16 +13,16 @@ ...@@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/StandardLogHandler.h> #include <folly/logging/StandardLogHandler.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <folly/experimental/logging/LogFormatter.h> #include <folly/logging/LogFormatter.h>
#include <folly/experimental/logging/LogHandlerConfig.h> #include <folly/logging/LogHandlerConfig.h>
#include <folly/experimental/logging/LogLevel.h> #include <folly/logging/LogLevel.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/experimental/logging/LogWriter.h> #include <folly/logging/LogWriter.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/test/TestLogHandler.h> #include <folly/logging/test/TestLogHandler.h>
#include <folly/MapUtil.h> #include <folly/MapUtil.h>
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <folly/experimental/logging/LogHandler.h> #include <folly/logging/LogHandler.h>
#include <folly/experimental/logging/LogHandlerConfig.h> #include <folly/logging/LogHandlerConfig.h>
#include <folly/experimental/logging/LogHandlerFactory.h> #include <folly/logging/LogHandlerFactory.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
namespace folly { namespace folly {
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/test/XlogHeader1.h> #include <folly/logging/test/XlogHeader1.h>
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
namespace logging_test { namespace logging_test {
void testXlogFile1Dbg1(folly::StringPiece msg) { void testXlogFile1Dbg1(folly::StringPiece msg) {
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/test/XlogHeader1.h> #include <folly/logging/test/XlogHeader1.h>
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
namespace logging_test { namespace logging_test {
void testXlogFile2Dbg1(folly::StringPiece msg) { void testXlogFile2Dbg1(folly::StringPiece msg) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
namespace logging_test { namespace logging_test {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
namespace logging_test { namespace logging_test {
inline void testXlogHdrFunction(folly::StringPiece str, int value) { inline void testXlogHdrFunction(folly::StringPiece str, int value) {
......
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
#include <folly/experimental/logging/LogCategory.h> #include <folly/logging/LogCategory.h>
#include <folly/experimental/logging/LogHandler.h> #include <folly/logging/LogHandler.h>
#include <folly/experimental/logging/LogMessage.h> #include <folly/logging/LogMessage.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <folly/experimental/logging/test/TestLogHandler.h> #include <folly/logging/test/TestLogHandler.h>
#include <folly/experimental/logging/test/XlogHeader1.h> #include <folly/logging/test/XlogHeader1.h>
#include <folly/experimental/logging/test/XlogHeader2.h> #include <folly/logging/test/XlogHeader2.h>
#include <folly/portability/Constexpr.h> #include <folly/portability/Constexpr.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/TestUtils.h> #include <folly/test/TestUtils.h>
...@@ -98,10 +98,8 @@ TEST(Xlog, perFileCategoryHandling) { ...@@ -98,10 +98,8 @@ TEST(Xlog, perFileCategoryHandling) {
using namespace logging_test; using namespace logging_test;
auto handler = make_shared<TestLogHandler>(); auto handler = make_shared<TestLogHandler>();
LoggerDB::get() LoggerDB::get().getCategory("folly.logging.test")->addHandler(handler);
.getCategory("folly.experimental.logging.test") LoggerDB::get().setLevel("folly.logging.test", LogLevel::DBG9);
->addHandler(handler);
LoggerDB::get().setLevel("folly.experimental.logging.test", LogLevel::DBG9);
auto& messages = handler->getMessages(); auto& messages = handler->getMessages();
// Use the simple helper function in XlogHeader2 // Use the simple helper function in XlogHeader2
...@@ -112,9 +110,9 @@ TEST(Xlog, perFileCategoryHandling) { ...@@ -112,9 +110,9 @@ TEST(Xlog, perFileCategoryHandling) {
<< "unexpected file name: " << messages[0].first.getFileName(); << "unexpected file name: " << messages[0].first.getFileName();
EXPECT_EQ(LogLevel::DBG3, messages[0].first.getLevel()); EXPECT_EQ(LogLevel::DBG3, messages[0].first.getLevel());
EXPECT_EQ( EXPECT_EQ(
"folly.experimental.logging.test.XlogHeader2.h", "folly.logging.test.XlogHeader2.h",
messages[0].first.getCategory()->getName()); messages[0].first.getCategory()->getName());
EXPECT_EQ("folly.experimental.logging.test", messages[0].second->getName()); EXPECT_EQ("folly.logging.test", messages[0].second->getName());
messages.clear(); messages.clear();
// Test the loop function from XlogHeader1 // Test the loop function from XlogHeader1
...@@ -125,9 +123,9 @@ TEST(Xlog, perFileCategoryHandling) { ...@@ -125,9 +123,9 @@ TEST(Xlog, perFileCategoryHandling) {
<< "unexpected file name: " << messages[0].first.getFileName(); << "unexpected file name: " << messages[0].first.getFileName();
EXPECT_EQ(LogLevel::DBG1, messages[0].first.getLevel()); EXPECT_EQ(LogLevel::DBG1, messages[0].first.getLevel());
EXPECT_EQ( EXPECT_EQ(
"folly.experimental.logging.test.XlogHeader1.h", "folly.logging.test.XlogHeader1.h",
messages[0].first.getCategory()->getName()); messages[0].first.getCategory()->getName());
EXPECT_EQ("folly.experimental.logging.test", messages[0].second->getName()); EXPECT_EQ("folly.logging.test", messages[0].second->getName());
EXPECT_EQ("test: hello world", messages[1].first.getMessage()); EXPECT_EQ("test: hello world", messages[1].first.getMessage());
EXPECT_EQ("test: hello world", messages[2].first.getMessage()); EXPECT_EQ("test: hello world", messages[2].first.getMessage());
...@@ -141,7 +139,7 @@ TEST(Xlog, perFileCategoryHandling) { ...@@ -141,7 +139,7 @@ TEST(Xlog, perFileCategoryHandling) {
// Reduce the log level so that the messages inside the loop // Reduce the log level so that the messages inside the loop
// should not be logged. // should not be logged.
LoggerDB::get().setLevel("folly.experimental.logging.test", LogLevel::DBG2); LoggerDB::get().setLevel("folly.logging.test", LogLevel::DBG2);
testXlogHdrLoop(300, "hello world"); testXlogHdrLoop(300, "hello world");
ASSERT_EQ(2, messages.size()); ASSERT_EQ(2, messages.size());
EXPECT_EQ("starting: hello world", messages[0].first.getMessage()); EXPECT_EQ("starting: hello world", messages[0].first.getMessage());
...@@ -154,7 +152,7 @@ TEST(Xlog, perFileCategoryHandling) { ...@@ -154,7 +152,7 @@ TEST(Xlog, perFileCategoryHandling) {
ASSERT_EQ(1, messages.size()); ASSERT_EQ(1, messages.size());
EXPECT_EQ("file1: foobar 1234", messages[0].first.getMessage()); EXPECT_EQ("file1: foobar 1234", messages[0].first.getMessage());
EXPECT_EQ( EXPECT_EQ(
"folly.experimental.logging.test.XlogFile1.cpp", "folly.logging.test.XlogFile1.cpp",
messages[0].first.getCategory()->getName()); messages[0].first.getCategory()->getName());
messages.clear(); messages.clear();
...@@ -162,27 +160,26 @@ TEST(Xlog, perFileCategoryHandling) { ...@@ -162,27 +160,26 @@ TEST(Xlog, perFileCategoryHandling) {
ASSERT_EQ(1, messages.size()); ASSERT_EQ(1, messages.size());
EXPECT_EQ("file2: hello world", messages[0].first.getMessage()); EXPECT_EQ("file2: hello world", messages[0].first.getMessage());
EXPECT_EQ( EXPECT_EQ(
"folly.experimental.logging.test.XlogFile2.cpp", "folly.logging.test.XlogFile2.cpp",
messages[0].first.getCategory()->getName()); messages[0].first.getCategory()->getName());
messages.clear(); messages.clear();
// Adjust the log level and make sure the changes take effect for the .cpp // Adjust the log level and make sure the changes take effect for the .cpp
// file categories // file categories
LoggerDB::get().setLevel("folly.experimental.logging.test", LogLevel::INFO); LoggerDB::get().setLevel("folly.logging.test", LogLevel::INFO);
testXlogFile1Dbg1("log check should fail now"); testXlogFile1Dbg1("log check should fail now");
testXlogFile2Dbg1("this should fail too"); testXlogFile2Dbg1("this should fail too");
EXPECT_EQ(0, messages.size()); EXPECT_EQ(0, messages.size());
messages.clear(); messages.clear();
LoggerDB::get().setLevel( LoggerDB::get().setLevel("folly.logging.test.XlogFile1", LogLevel::DBG1);
"folly.experimental.logging.test.XlogFile1", LogLevel::DBG1);
testXlogFile1Dbg1("this log check should pass now"); testXlogFile1Dbg1("this log check should pass now");
testXlogFile2Dbg1("but this one should still fail"); testXlogFile2Dbg1("but this one should still fail");
ASSERT_EQ(1, messages.size()); ASSERT_EQ(1, messages.size());
EXPECT_EQ( EXPECT_EQ(
"file1: this log check should pass now", messages[0].first.getMessage()); "file1: this log check should pass now", messages[0].first.getMessage());
EXPECT_EQ( EXPECT_EQ(
"folly.experimental.logging.test.XlogFile1.cpp", "folly.logging.test.XlogFile1.cpp",
messages[0].first.getCategory()->getName()); messages[0].first.getCategory()->getName());
messages.clear(); messages.clear();
} }
......
...@@ -28,8 +28,9 @@ class FatalTests(unittest.TestCase): ...@@ -28,8 +28,9 @@ class FatalTests(unittest.TestCase):
self.helper = fatal_helper_env self.helper = fatal_helper_env
else: else:
build_dir = os.path.join(os.getcwd(), 'buck-out', 'gen') build_dir = os.path.join(os.getcwd(), 'buck-out', 'gen')
self.helper = os.path.join(build_dir, 'folly', 'experimental', self.helper = os.path.join(
'logging', 'test', 'fatal_helper') build_dir, 'folly', 'logging', 'test', 'fatal_helper'
)
def run_helper(self, *args, **kwargs): def run_helper(self, *args, **kwargs):
''' '''
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/experimental/logging/xlog.h> #include <folly/logging/xlog.h>
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
using folly::StringPiece; using folly::StringPiece;
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/experimental/logging/LogStream.h> #include <folly/logging/LogStream.h>
#include <folly/experimental/logging/Logger.h> #include <folly/logging/Logger.h>
#include <folly/experimental/logging/LoggerDB.h> #include <folly/logging/LoggerDB.h>
#include <cstdlib> #include <cstdlib>
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment