3
3
## Overview
4
4
5
5
Header-only [ ` spdlog ` ] ( https://github.com/gabime/spdlog ) file-based setup
6
- library for convenience in initializing spdlog. Inspired by
7
- [ ` spdlog-config ` ] ( https://github.com/objectx/spdlog-config ) for using
6
+ library for convenience in initializing spdlog. It is using
8
7
[ ` TOML ` ] ( https://github.com/toml-lang/toml ) configuration, a format that is
9
8
simple and easy-to-read.
10
9
11
- [ ![ Build Status] ( https://travis-ci.org/guangie88/spdlog_setup.svg?branch=master )] ( https://travis-ci.org/guangie88/spdlog_setup )
12
- [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/srek5xih80104eds/branch/master?svg=true )] ( https://ci.appveyor.com/project/guangie88/spdlog-setup/branch/master )
13
- [ ![ codecov] ( https://codecov.io/gh/guangie88/spdlog_setup/branch/master/graph/badge.svg )] ( https://codecov.io/gh/guangie88/spdlog_setup )
14
-
15
10
## Requirements
16
11
17
- Requires at least ` CMake 3.3 ` , ` g++-4.9 ` for Linux, or ` MSVC2015 ` with ` MSBuild `
18
- for Windows, providing sufficient C++11 features.
19
-
20
- ` g++-4.8 ` will notably fail because of the missing ` std::regex ` implementation.
21
- ` MSVC2013 ` will fail too as it does not accept ` noexcept ` , which is used in some
22
- of the functions.
23
-
24
- Tested against:
25
-
26
- - ` g++-4.9 `
27
- - ` g++-5 `
28
- - ` g++-6 `
29
- - ` g++-7 `
30
- - ` g++-8 `
31
- - ` clang-3.6 `
32
- - ` clang-3.7 `
33
- - ` clang-3.8 `
34
- - ` clang-3.9 `
35
- - ` clang-4.0 `
36
- - ` clang-5.0 `
37
- - ` clang-6.0 `
38
- - ` clang-7 `
39
- - ` cl ` (v140 / MSVC2015)
40
- - ` cl ` (v141 / MSVC2017)
12
+ Requires at least ` Conan v1.59 ` or ` Conan v2.x `
41
13
42
14
## Features
43
15
44
- - Header-only (check [ ` How to Install ` ] ( #how-to-install ) to extract out the
45
- header files).
16
+ - Header-only
46
17
- Initialization of ` spdlog ` sinks, patterns and loggers based on ` TOML `
47
18
configuration file.
48
19
- Tag replacement (e.g. "{tagname}-log.txt") within the ` TOML ` configuration
@@ -53,94 +24,19 @@ Tested against:
53
24
54
25
See [ CHANGELOG.md] ( ./CHANGELOG.md ) for more details.
55
26
56
- ## Repository Checkout
57
-
58
- Since this repository has other git-based dependencies as ` git ` submodules, use
59
- the command:
60
- ` git clone --recursive https://github.com/guangie88/spdlog_setup.git ` in order
61
- to clone all the submodule dependencies.
62
-
63
- If the repository has already been cloned without the submodules, then instead
64
- run: ` git submodule update --init --recursive ` in order to clone all the
65
- submodule dependencies.
66
-
67
27
## Dependencies
68
28
69
29
This repository uses the following external dependencies directly:
70
30
71
31
- [ ` Catch ` ] ( https://github.com/philsquared/Catch ) (only for unit-tests, not
72
32
included in installation)
73
33
- [ ` spdlog ` ] ( https://github.com/gabime/spdlog )
74
-
75
- In addition, the following dependencies are inlined as part of the include:
76
-
77
34
- [ ` cpptoml ` ] ( https://github.com/skystrife/cpptoml )
78
35
- [ ` fmt ` ] ( https://github.com/fmtlib/fmt.git )
79
36
80
37
## How to Build
81
38
82
- This guide prefers a ` CMake ` out-of-source build style. For build with unit
83
- tests, add ` -DSPDLOG_SETUP_INCLUDE_UNIT_TESTS=ON ` during the CMake
84
- configuration.
85
-
86
- ## How to Install
87
-
88
- If a recent enough ` spdlog ` is already available, and unit tests are not to be
89
- run, it is possible to just copy the ` spdlog_setup ` directory within ` include `
90
- into another solution for header-only include, as long as ` spdlog ` can be found
91
- in that solution.
92
-
93
- If ` spdlog ` is not available, the installation step of ` CMake ` can copy out the
94
- entire list of header files required for ` spdlog_setup ` into the installation
95
- directory, including ` spdlog ` . To change the installation directory, add
96
- ` -DCMAKE_INSTALL_PREFIX=<path-to-install> ` during the CMake configuration.
97
-
98
- ### Linux (` GCC ` )
99
-
100
- In the root directory after ` git ` cloning:
101
-
102
- #### Debug without Installation
103
-
104
- - ` mkdir build-debug `
105
- - ` cd build-debug `
106
- - ` cmake .. -DCMAKE_BUILD_TYPE=Debug -DSPDLOG_SETUP_INCLUDE_UNIT_TESTS=ON `
107
- - ` cmake --build . `
108
-
109
- Now the unit test executable should be compiled and residing in
110
- ` build-debug/spdlog_setup_unit_test ` .
111
-
112
- #### Release with Installation
113
-
114
- - ` mkdir build-release `
115
- - ` cd build-release `
116
- - ` cmake .. -DCMAKE_BUILD_TYPE=Release -DSPDLOG_SETUP_INCLUDE_UNIT_TESTS=ON -DCMAKE_INSTALL_PREFIX=install `
117
- - ` cmake --build . --target install `
118
-
119
- Now the unit test executable should be compiled and residing in
120
- ` build-release/spdlog_setup_unit_test ` .
121
-
122
- The header files should be installed in ` build-release/install/include ` .
123
-
124
- ### Windows (` MSVC2015 ` as Example)
125
-
126
- Ensure that [ ` Microsoft Build Tools 2015 ` ] ( https://www.microsoft.com/en-sg/download/details.aspx?id=48159 )
127
- and [ ` Visual C++ Build Tools 2015 ` ] ( http://landinghub.visualstudio.com/visual-cpp-build-tools )
128
- (or ` Visual Studio 2015 ` ) have been installed.
129
-
130
- In the root directory after ` git ` cloning:
131
-
132
- - ` mkdir build `
133
- - ` cd build `
134
- - ` cmake .. -G "Visual Studio 14 Win64" -DSPDLOG_SETUP_INCLUDE_UNIT_TESTS=ON -DCMAKE_INSTALL_PREFIX=install `
135
- - (Debug) ` cmake --build . --config Debug `
136
- - (Release with installation) ` cmake --build . --config Release --target install `
137
-
138
- Now the unit test executable should be compiled and residing in
139
-
140
- - (Debug) ` build/Debug/spdlog_setup_unit_test.exe ` or
141
- - (Release) ` build/Release/spdlog_setup_unit_test.exe ` .
142
-
143
- The header files should be installed in ` build/install/include ` .
39
+ - ` conan build -b mising . `
144
40
145
41
## Supported Sinks
146
42
@@ -391,7 +287,6 @@ level = "trace"
391
287
392
288
``` c++
393
289
#include < spdlog_setup/spdlog_setup.hpp>
394
-
395
290
#include < iostream>
396
291
#include < string>
397
292
@@ -422,7 +317,6 @@ int main() {
422
317
423
318
``` c++
424
319
#include < spdlog_setup/spdlog_setup.hpp>
425
-
426
320
#include < string>
427
321
428
322
int main (const int argc, const char * argv[ ] ) {
@@ -475,23 +369,8 @@ all the source code files.
475
369
Please try to run
476
370
477
371
```bash
478
- ./run-clang-format .sh
372
+ ./reformat .sh
479
373
```
480
374
481
375
which will pull the appropriate Docker image to run the formatting command over
482
376
the entire repository directory.
483
-
484
- If your ` docker ` command requires ` sudo ` , then you will need to run it as
485
-
486
- ``` bash
487
- sudo sh ./run-clang-format.sh
488
- ```
489
-
490
- Alternatively, you could also try to set up your own ` clang-format ` (currently
491
- this repository uses version 7), and run
492
-
493
- ``` bash
494
- clang-format -i path_to_h_cpp_file
495
- ```
496
-
497
- over the changed files.
0 commit comments