Loading .clang-format 0 → 100644 +108 −0 Original line number Diff line number Diff line --- Language: Cpp # BasedOnStyle: LLVM AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Right AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: true AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: true BinPackArguments: true BinPackParameters: true BraceWrapping: AfterClass: true AfterControlStatement: true AfterEnum: true AfterFunction: true AfterNamespace: false AfterObjCDeclaration: true AfterStruct: true AfterUnion: true BeforeCatch: true BeforeElse: true IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BreakBeforeInheritanceComma: false BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: true BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 140 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 - Regex: '^(<|"(gtest|gmock|isl|json)/)' Priority: 3 - Regex: '.*' Priority: 1 IncludeIsMainRegex: '(Test)?$' IndentCaseLabels: false IndentWidth: 4 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: true MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right ReflowComments: true SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 8 UseTab: Never ... .gitignore +5 −1 Original line number Diff line number Diff line # Auto generated files build/* *.slo *.lo *.o Loading Loading @@ -65,3 +66,6 @@ install_manifest.txt # idea .idea/ # vscode .vscode/ No newline at end of file CMakeLists.txt +2 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ # cmake_minimum_required(VERSION 3.1) project(spdlog VERSION 0.16.2) project(spdlog VERSION 0.17.0 LANGUAGES CXX) include(CTest) include(CMakeDependentOption) include(GNUInstallDirs) Loading @@ -16,7 +16,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "-Wall -O3 ${CMAKE_CXX_FLAGS}") endif() #--------------------------------------------------------------------------------------- Loading Loading @@ -73,7 +73,6 @@ configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY) install( TARGETS spdlog EXPORT "${targets_export_name}" INCLUDES DESTINATION "${include_install_dir}" ) # install headers Loading README.md +11 −11 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ Very fast, header only, C++ logging library. [ using the excellent [fmt](https://github.com/fmtlib/fmt) library. * Optional printf syntax support. * Extremely fast asynchronous mode (optional) - using lockfree queues and other tricks to reach millions of calls/sec. * Asynchronous mode (optional) * [Custom](https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) formatting. * Conditional Logging * Multi/Single threaded loggers. Loading @@ -54,9 +54,9 @@ Time needed to log 1,000,000 lines in synchronous mode (in seconds, the best of |threads|boost log 1.54|glog |easylogging |spdlog| |-------|:-------:|:-----:|----------:|------:| |1| 4.169s |1.066s |0.975s |0.302s| |10| 6.180s |3.032s |2.857s |0.968s| |100| 5.981s |1.139s |4.512s |0.497s| |1| 4.169s |1.066s |0.975s |0.392s| |10| 6.180s |3.032s |2.857s |0.773s| |100| 5.981s |1.139s |4.512s |0.587s| #### Asynchronous mode Loading @@ -64,9 +64,9 @@ Time needed to log 1,000,000 lines in asynchronous mode, i.e. the time it takes |threads|g2log <sup>async logger</sup> |spdlog <sup>async mode</sup>| |:-------|:-----:|-------------------------:| |1| 1.850s |0.216s | |10| 0.943s |0.173s| |100| 0.959s |0.202s| |1| 1.850s |0.39s | |10| 0.943s |0.416s| |100| 0.959s |0.413s| Loading Loading @@ -120,9 +120,9 @@ int main(int, char*[]) daily_logger->info(123.44); // Customize msg format for all messages spd::set_pattern("*** [%H:%M:%S %z] [thread %t] %v ***"); rotating_logger->info("This is another message with custom format"); spd::set_pattern("[%^+++%$] [%H:%M:%S %z] [thread %t] %v"); console->info("This an info message with custom format (and custom color range between the '%^' and '%$')"); console->error("This an error message with custom format (and custom color range between the '%^' and '%$')"); // Runtime log levels spd::set_level(spd::level::info); //Set global log level to info Loading Loading @@ -170,7 +170,7 @@ int main(int, char*[]) void async_example() { size_t q_size = 4096; //queue size must be power of 2 size_t q_size = 4096; spd::set_async_mode(q_size); auto async_file = spd::daily_logger_st("async_file_logger", "logs/async_log.txt"); for (int i = 0; i < 100; ++i) Loading astyle.shdeleted 100755 → 0 +0 −5 Original line number Diff line number Diff line #!/bin/bash find . -name "*\.h" -o -name "*\.cpp"|xargs dos2unix find . -name "*\.h" -o -name "*\.cpp"|xargs astyle -n -c -A1 Loading
.clang-format 0 → 100644 +108 −0 Original line number Diff line number Diff line --- Language: Cpp # BasedOnStyle: LLVM AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Right AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: true AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: true BinPackArguments: true BinPackParameters: true BraceWrapping: AfterClass: true AfterControlStatement: true AfterEnum: true AfterFunction: true AfterNamespace: false AfterObjCDeclaration: true AfterStruct: true AfterUnion: true BeforeCatch: true BeforeElse: true IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BreakBeforeInheritanceComma: false BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: true BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 140 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 - Regex: '^(<|"(gtest|gmock|isl|json)/)' Priority: 3 - Regex: '.*' Priority: 1 IncludeIsMainRegex: '(Test)?$' IndentCaseLabels: false IndentWidth: 4 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: true MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right ReflowComments: true SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 8 UseTab: Never ...
.gitignore +5 −1 Original line number Diff line number Diff line # Auto generated files build/* *.slo *.lo *.o Loading Loading @@ -65,3 +66,6 @@ install_manifest.txt # idea .idea/ # vscode .vscode/ No newline at end of file
CMakeLists.txt +2 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ # cmake_minimum_required(VERSION 3.1) project(spdlog VERSION 0.16.2) project(spdlog VERSION 0.17.0 LANGUAGES CXX) include(CTest) include(CMakeDependentOption) include(GNUInstallDirs) Loading @@ -16,7 +16,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "-Wall -O3 ${CMAKE_CXX_FLAGS}") endif() #--------------------------------------------------------------------------------------- Loading Loading @@ -73,7 +73,6 @@ configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY) install( TARGETS spdlog EXPORT "${targets_export_name}" INCLUDES DESTINATION "${include_install_dir}" ) # install headers Loading
README.md +11 −11 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ Very fast, header only, C++ logging library. [ using the excellent [fmt](https://github.com/fmtlib/fmt) library. * Optional printf syntax support. * Extremely fast asynchronous mode (optional) - using lockfree queues and other tricks to reach millions of calls/sec. * Asynchronous mode (optional) * [Custom](https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) formatting. * Conditional Logging * Multi/Single threaded loggers. Loading @@ -54,9 +54,9 @@ Time needed to log 1,000,000 lines in synchronous mode (in seconds, the best of |threads|boost log 1.54|glog |easylogging |spdlog| |-------|:-------:|:-----:|----------:|------:| |1| 4.169s |1.066s |0.975s |0.302s| |10| 6.180s |3.032s |2.857s |0.968s| |100| 5.981s |1.139s |4.512s |0.497s| |1| 4.169s |1.066s |0.975s |0.392s| |10| 6.180s |3.032s |2.857s |0.773s| |100| 5.981s |1.139s |4.512s |0.587s| #### Asynchronous mode Loading @@ -64,9 +64,9 @@ Time needed to log 1,000,000 lines in asynchronous mode, i.e. the time it takes |threads|g2log <sup>async logger</sup> |spdlog <sup>async mode</sup>| |:-------|:-----:|-------------------------:| |1| 1.850s |0.216s | |10| 0.943s |0.173s| |100| 0.959s |0.202s| |1| 1.850s |0.39s | |10| 0.943s |0.416s| |100| 0.959s |0.413s| Loading Loading @@ -120,9 +120,9 @@ int main(int, char*[]) daily_logger->info(123.44); // Customize msg format for all messages spd::set_pattern("*** [%H:%M:%S %z] [thread %t] %v ***"); rotating_logger->info("This is another message with custom format"); spd::set_pattern("[%^+++%$] [%H:%M:%S %z] [thread %t] %v"); console->info("This an info message with custom format (and custom color range between the '%^' and '%$')"); console->error("This an error message with custom format (and custom color range between the '%^' and '%$')"); // Runtime log levels spd::set_level(spd::level::info); //Set global log level to info Loading Loading @@ -170,7 +170,7 @@ int main(int, char*[]) void async_example() { size_t q_size = 4096; //queue size must be power of 2 size_t q_size = 4096; spd::set_async_mode(q_size); auto async_file = spd::daily_logger_st("async_file_logger", "logs/async_log.txt"); for (int i = 0; i < 100; ++i) Loading
astyle.shdeleted 100755 → 0 +0 −5 Original line number Diff line number Diff line #!/bin/bash find . -name "*\.h" -o -name "*\.cpp"|xargs dos2unix find . -name "*\.h" -o -name "*\.cpp"|xargs astyle -n -c -A1