Skip to content

Commit

Permalink
Fix to support spdlog v1.y.z (#28)
Browse files Browse the repository at this point in the history
* Fix general breaking file sinks breaking changes in spdlog v1.0.0

* Fix syslog test cases

* Remove all third_party/fmt and use spdlog/fmt instead

* Pin to latest spdlog v1.2.1 to indicate last working version

* Fix v1.3.0 and v1.3.1 enum issue and pin v1.3.1

* Add more details to CHANGELOG

* Make syslog include to be within non-Windows side only

* Shift using keywords for syslog

* Bump alpha version
  • Loading branch information
guangie88 authored Feb 28, 2019
1 parent d21ceba commit e856be1
Show file tree
Hide file tree
Showing 23 changed files with 110 additions and 6,506 deletions.
16 changes: 11 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

## Unreleased

- Change support to `spdlog` `v1.y.z` tag release, currently tested all `v1.0.0`
to `v1.3.1` to be working. This fixes
([#26](https://github.com/guangie88/spdlog_setup/issues/26)).
- `simple_file_sink_st` becomes `basic_file_sink_st`
- `simple_file_sink_mt` becomes `basic_file_sink_mt`
- `syslog_sink` splits into `syslog_sink_st` and `syslog_sink_mt`
- Fix CMake package finding failure when installed using submodule `spdlog`
([#23](https://github.com/guangie88/spdlog_setup/issues/23)).
- Fix global pattern not used by subsequent loggers other than the first
([#19](https://github.com/guangie88/spdlog_setup/issues/19)).
- Add functions that allow configuration overrides:
- `from_file_and_override`
- `from_file_and_override_with_tag_replacement`
- `save_logger_to_file`
- `delete_logger_in_file`
- Fix CMake package finding failure when installed using submodule `spdlog`
([#23](https://github.com/guangie88/spdlog_setup/issues/23))
- Fix global pattern not used by subsequent loggers other than the first
([#19](https://github.com/guangie88/spdlog_setup/issues/19)).

## v0.2
## v0.2 (Tested to support `v0.16.z` to `v0.17.0`)

- Use `spdlog_setup/conf.h` instead of `spdlog_setup.h`. Reason for change is
to allow inlining of `cpptoml` and `fmt` libraries.
Expand Down
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ The header files should be installed in `build/install/include`.
- `stdout_sink_mt`
- `color_stdout_sink_st`
- `color_stdout_sink_mt`
- `simple_file_sink_st`
- `simple_file_sink_mt`
- `basic_file_sink_st`
- `basic_file_sink_mt`
- `rotating_file_sink_st`
- `rotating_file_sink_mt`
- `daily_file_sink_st`
Expand Down Expand Up @@ -204,7 +204,7 @@ type = "color_stdout_sink_mt"

[[sink]]
name = "file_out"
type = "simple_file_sink_st"
type = "basic_file_sink_st"
filename = "log/spdlog_setup.log"
# truncate field is optional
# truncate = false (default)
Expand All @@ -214,7 +214,7 @@ create_parent_dir = true

[[sink]]
name = "file_err"
type = "simple_file_sink_mt"
type = "basic_file_sink_mt"
filename = "log/spdlog_setup_err.log"
truncate = true
level = "err"
Expand Down Expand Up @@ -262,8 +262,17 @@ type = "null_sink_mt"

# only works for Linux
[[sink]]
name = "syslog"
type = "syslog_sink"
name = "syslog_st"
type = "syslog_sink_st"
# generally no need to fill up the optional fields below
# ident = "" (default)
# syslog_option = 0 (default)
# syslog_facility = LOG_USER (default macro value)

# only works for Linux
[[sink]]
name = "syslog_mt"
type = "syslog_sink_mt"
# generally no need to fill up the optional fields below
# ident = "" (default)
# syslog_option = 0 (default)
Expand All @@ -282,7 +291,7 @@ sinks = [
"file_out", "file_err",
"rotate_out", "rotate_err",
"null_sink_st", "null_sink_mt",
"syslog"]
"syslog_st", "syslog_mt"]
level = "trace"

[[logger]]
Expand Down Expand Up @@ -320,7 +329,7 @@ create_parent_dir = true

[[sink]]
name = "simple_err"
type = "simple_file_sink_mt"
type = "basic_file_sink_mt"
filename = "log/{index}-err/simple-{path}.log"
truncate = false
level = "err"
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.3.0-alpha.1.{build}
version: 0.3.0-alpha.2.{build}

image:
- Visual Studio 2015
Expand Down
2 changes: 1 addition & 1 deletion config/log_conf.pre.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ create_parent_dir = true

[[sink]]
name = "simple_err"
type = "simple_file_sink_mt"
type = "basic_file_sink_mt"
filename = "log/{index}-err/simple-{path}.log"
truncate = false
level = "err"
Expand Down
19 changes: 14 additions & 5 deletions config/log_conf_linux.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type = "color_stdout_sink_mt"

[[sink]]
name = "file_out"
type = "simple_file_sink_st"
type = "basic_file_sink_st"
filename = "log/spdlog_setup.log"
# truncate field is optional
# truncate = false (default)
Expand All @@ -41,7 +41,7 @@ create_parent_dir = true

[[sink]]
name = "file_err"
type = "simple_file_sink_mt"
type = "basic_file_sink_mt"
filename = "log/spdlog_setup_err.log"
truncate = true
level = "err"
Expand Down Expand Up @@ -89,8 +89,17 @@ type = "null_sink_mt"

# only works for Linux
[[sink]]
name = "syslog"
type = "syslog_sink"
name = "syslog_st"
type = "syslog_sink_st"
# generally no need to fill up the optional fields below
# ident = "" (default)
# syslog_option = 0 (default)
# syslog_facility = LOG_USER (default macro value)

# only works for Linux
[[sink]]
name = "syslog_mt"
type = "syslog_sink_mt"
# generally no need to fill up the optional fields below
# ident = "" (default)
# syslog_option = 0 (default)
Expand All @@ -109,7 +118,7 @@ sinks = [
"file_out", "file_err",
"rotate_out", "rotate_err",
"null_sink_st", "null_sink_mt",
"syslog"]
"syslog_st"]
level = "trace"

[[logger]]
Expand Down
13 changes: 2 additions & 11 deletions config/log_conf_win.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type = "color_stdout_sink_mt"

[[sink]]
name = "file_out"
type = "simple_file_sink_st"
type = "basic_file_sink_st"
filename = "log/spdlog_setup.log"
# truncate field is optional
# truncate = false (default)
Expand All @@ -41,7 +41,7 @@ create_parent_dir = true

[[sink]]
name = "file_err"
type = "simple_file_sink_mt"
type = "basic_file_sink_mt"
filename = "log/spdlog_setup_err.log"
truncate = true
level = "err"
Expand Down Expand Up @@ -87,15 +87,6 @@ type = "null_sink_st"
name = "null_sink_mt"
type = "null_sink_mt"

# only works for Linux
# [[sink]]
# name = "syslog"
# type = "syslog_sink"
# generally no need to fill up the optional fields below
# ident = "" (default)
# syslog_option = 0 (default)
# syslog_facility = LOG_USER (default macro value)

[[pattern]]
name = "succient"
value = "%c-%L: %v"
Expand Down
2 changes: 1 addition & 1 deletion deps/spdlog
Submodule spdlog updated 135 files
2 changes: 1 addition & 1 deletion include/spdlog_setup/conf.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Implementation of public facing functions in spdlog_setup.
* @author Chen Weiguang
* @version 0.3.0-alpha.1
* @version 0.3.0-alpha.2
*/

#pragma once
Expand Down
Loading

0 comments on commit e856be1

Please sign in to comment.