Skip to content

Commit 68e4649

Browse files
committed
Change logging timestamp format to include milliseconds and be consistent between Ctxt and not
1 parent f4b0a71 commit 68e4649

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

modules/c++/avx/include/avx/extractf.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
* (C) Copyright 2004 - 2019, MDA Information Systems LLC
66
* (C) Copyright 2021, Maxar Technologies, Inc.
7+
* (C) Copyright 2025, Arka Group, L.P.
78
*
89
* config-c++ is free software; you can redistribute it and/or modify
910
* it under the terms of the GNU Lesser General Public License as published by
@@ -26,6 +27,7 @@
2627

2728
#include <config/compiler_extensions.h>
2829

30+
#ifdef __AVX__
2931
#ifndef CODA_OSS_mm256_extractf_DEFINED_
3032
#define CODA_OSS_mm256_extractf_DEFINED_ 1
3133

@@ -53,5 +55,6 @@
5355
}
5456

5557
#endif
58+
#endif
5659

5760
#endif // CODA_OSS_avx_extractf_h_INCLUDED_

modules/c++/sys/include/sys/Conf.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
66
* (C) Copyright 2021, Maxar Technologies, Inc.
7+
* (C) Copyright 2025, Arka Group, L.P.
78
*
89
* sys-c++ is free software; you can redistribute it and/or modify
910
* it under the terms of the GNU Lesser General Public License as published by
@@ -33,7 +34,7 @@
3334
// POSIX is more-or-less "Unix"
3435
// https://linux.die.net/man/7/feature_test_macros
3536
// "If no feature test macros are explicitly defined, then the following feature test macros
36-
// are defined by default: ... _POSIX_SOURCE, and _POSIX_C_SOURCE=200809L. [...]
37+
// are defined by default: ... _POSIX_SOURCE, and _POSIX_C_SOURCE=200809L. [...]
3738
// _POSIX_SOURCE Defining this obsolete macro ... is equivalent to defining _POSIX_C_SOURCE ..."
3839
#ifndef _WIN32
3940
#include <features.h>
@@ -159,7 +160,7 @@ namespace sys
159160
#define SYS_FUNC NativeLayer_func__
160161

161162
#define Ctxt(MESSAGE) except::Context(__FILE__, __LINE__, SYS_FUNC, \
162-
sys::TimeStamp().local(), MESSAGE)
163+
sys::TimeStamp(true).local(), MESSAGE)
163164

164165
namespace sys
165166
{

modules/c++/sys/include/sys/TimeStamp.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* =========================================================================
2-
* This file is part of sys-c++
2+
* This file is part of sys-c++
33
* =========================================================================
4-
*
4+
*
55
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
6+
* (C) Copyright 2025, Arka Group, L.P.
67
*
78
* sys-c++ is free software; you can redistribute it and/or modify
89
* it under the terms of the GNU Lesser General Public License as published by
@@ -14,8 +15,8 @@
1415
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1516
* GNU Lesser General Public License for more details.
1617
*
17-
* You should have received a copy of the GNU Lesser General Public
18-
* License along with this program; If not,
18+
* You should have received a copy of the GNU Lesser General Public
19+
* License along with this program; If not,
1920
* see <http://www.gnu.org/licenses/>.
2021
*
2122
*/
@@ -33,7 +34,7 @@
3334
/*!
3435
* \file TimeStamp.h
3536
* \brief Get a timestamp in a system-independent manner
36-
*
37+
*
3738
* Provide the API for timestamps
3839
*/
3940

@@ -66,7 +67,10 @@ struct TimeStamp final
6667
std::string local() const
6768
{
6869
sys::LocalDateTime dt;
69-
return dt.format(getFormat());
70+
std::string base = dt.format(getFormat());
71+
72+
double fracSec = fmod(dt.getSecond(), 1);
73+
return base + FmtX(".%03.0f", fracSec * 1000);
7074
}
7175

7276
/*!
@@ -76,7 +80,10 @@ struct TimeStamp final
7680
std::string gmt() const
7781
{
7882
sys::UTCDateTime dt;
79-
return dt.format(getFormat());
83+
std::string base = dt.format(getFormat());
84+
85+
double fracSec = fmod(dt.getSecond(), 1);
86+
return base + FmtX(".%03.0f", fracSec * 1000);
8087
}
8188

8289
private:

0 commit comments

Comments
 (0)