Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding additional log overload to prevent unnecessary fmt::format #1424

Merged
merged 1 commit into from
Feb 9, 2020
Merged

adding additional log overload to prevent unnecessary fmt::format #1424

merged 1 commit into from
Feb 9, 2020

Conversation

dominicpoeschko
Copy link
Contributor

calling log with a string_view as msg called

 template<typename... Args>
    void log(source_loc loc, level::level_enum lvl, string_view_t fmt, const Args &... args)

instead of

template<class T, typename std::enable_if<std::is_convertible<const T &, spdlog::string_view_t>::value, T>::type * = nullptr>
    void log(source_loc loc, level::level_enum lvl, const T &msg)

which lead to an unnecessary call to fmt::format

calling log with a string_view as msg called
```
 template<typename... Args>
    void log(source_loc loc, level::level_enum lvl, string_view_t fmt, const Args &... args)
```

instead of
```
template<class T, typename std::enable_if<std::is_convertible<const T &, spdlog::string_view_t>::value, T>::type * = nullptr>
    void log(source_loc loc, level::level_enum lvl, const T &msg)
```

which lead to an unnecessary call to fmt::format
@gabime gabime merged commit 573ddf8 into gabime:v1.x Feb 9, 2020
@gabime
Copy link
Owner

gabime commented Feb 9, 2020

Merged. Thanks.

@dominicpoeschko dominicpoeschko deleted the patch-2 branch February 10, 2020 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants