Timezone information with text file backend
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reading the file-sink filename pattern code and how it formats time values; the issue points to Boost.Log's text file backend and Boost.DateTime's documented format flags. Check existing tests for filename pattern expansion and add coverage for including a timezone offset such as +0200. Done means the requested filename format works and the relevant tests pass.
Written by the indexing model from the issue text.
Description
We're currently working on adding logging to our application and trying to get a log file in the following format: test_20230607T165634+0200.log
With the following code however, the resulting log file is test_20230607T165634.log. After reading the documentation is seems that boost log does not support any of the time zone flags, since it uses ptime internally (https://www.boost.org/doc/libs/1_82_0/doc/html/date_time/date_time_io.html#date_time.format_flags). Could support for this be added?
#include <boost/log/trivial.hpp>
#include <boost/log/utility/setup/file.hpp>
void init_logger(const std::string& filename)
{
auto sink = boost::log::add_file_log(boost::log::keywords::file_name = filename + "_%Y%m%dT%H%M%S%q.log");
}
int main(int, char**)
{
init_logger("test");
BOOST_LOG_TRIVIAL(info) << "Hello, World!";
}
- Dominant language
- C++
- Stars
- 211
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/log
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100