Commit 80e3e717 authored by Liam Keegan's avatar Liam Keegan Committed by Santiago Ospina De Los Ríos
Browse files

Replace %F and %T with their longer versions which are more portable

parent 75b7d612
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
We follow the [DUNE release cycle](https://www.dune-project.org/releases/).
<!--
Guiding Principles
Changelogs are for humans, not machines.
There should be an entry for every single version.
The same types of changes should be grouped.
Versions and sections should be linkable.
The latest version comes first.
The release date of each version is displayed.
Mention whether you follow Semantic Versioning.
Types of changes
Added for new features.
Changed for changes in existing functionality.
Deprecated for soon-to-be removed features.
Removed for now removed features.
Fixed for any bug fixes.
Security in case of vulnerabilities.
-->
## [Unreleased] ([git-diff][Unreleased-diff])
### Added
- [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) !15
- Support for `fmt` v8 !13
### Fixed
- Expand `%F` and `%T` to have better support on Windows !15
## [2.7.1] - 2021-02-10
### Fixed
- Fix fmt-installation-path !12
## [2.7.0] - 2021-02-10
### Added
- First release
[Unreleased-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v2.7.1...master
[Unreleased]: https://gitlab.dune-project.org/copasi/dune-copasi/-/tree/master
[2.7.1]: https://gitlab.dune-project.org/copasi/dune-copasi/-/releases/v2.7.1
[2.7.0]: https://gitlab.dune-project.org/copasi/dune-copasi/-/releases/v2.7.0
......@@ -523,12 +523,11 @@ namespace Dune::Logging {
#ifdef DUNE_HAVE_LOCALTIME_R
localtime_r(&startup_time,&local_time);
#else
std::tm* tm = std::localtime(&startup_time);
std::memcpy(&local_time,tm,sizeof(std::tm));
local_time = *std::localtime(&startup_time);
#endif
// We need to manually format the time, as doing so is not constexpr
auto time_string = fmt::format("{:%a %F %T %Z}",local_time);
auto time_string = fmt::format("{:%a %Y-%m-%d %H:%M:%S %Z}",local_time);
s.logger.notice("Logging system initialized at {}"_fmt,time_string);
}
......
......@@ -181,7 +181,7 @@ namespace Dune::Logging {
constexpr static std::string_view defaultPattern() noexcept
{
using namespace std::literals;
return "{reltime:8%T}.{relfraction:03} {msg}"sv;
return "{reltime:8%H:%M:%S}.{relfraction:03} {msg}"sv;
}
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment