Hi, I made some changes.
I make the following changes. I hope it looks good to you.
- a travis-ci.yml is added for automatic building and testing.
- windows specific
__declspec(thread)was replaced by keyword thread_local - add test about thread naming.
- Enable file-only logging (please see the commit message of 55a56120b8a820c7c86d20c2e371d94076ecd2ed)
Hi, thanks for your PR!
Some notes
__declspec(thread) was introduced in https://github.com/emilk/loguru/pull/36 by @justinian and I don't want to change that unless it still works on old VC versions.
About the file-only logging: I think you misunderstood my TODO: I want a way to be able to do LOG_F(INFO, "Both file and stderr"); LOG_F(FILE, "Only file"); – i.e. control it on a per-message basis, not globally.
The other things look good – I might cherry pick a few commits
Just to weigh in - I did choose the older-style __declspec(thread) for compatibility reasons. The thread_local keyword wasn't well supported until Visual Studio 2015. You could support both through a _MSC_VER check, but that seems like more of a maintenance headache for a single keyword.
Just to weigh in - I did choose the older-style
__declspec(thread)for compatibility reasons. Thethread_localkeyword wasn't well supported until Visual Studio 2015. You could support both through a_MSC_VERcheck, but that seems like more of a maintenance headache for a single keyword.
Would you reconsider using #ifdefs because the __declspec(thread) is ignored by the current MinGW-W64 compiler, but thread_local is supported? See https://github.com/sccn/liblsl/blob/master/testing/test_int_loguruthreadnames.cpp for a test that fails on MinGW unless thread_local is used.