Skip to content

Commit 0142dc9

Browse files
KlamptooVaughn
authored andcommitted
Change logging timestamp format to include milliseconds and be consistent between Ctxt and not
1 parent af86859 commit 0142dc9

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

cmake/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ These options may be passed in the cmake configure step as `-DOPTION_NAME="optio
8181
|ENABLE_PCRE|ON|build PCRE (PERL Compatible Regular Expressions) library and modules dependent on it|
8282
|ENABLE_UUID|ON|build uuid library and modules dependent on it|
8383
|ENABLE_ZIP|ON|build zlib and modules dependent on it|
84+
|ENABLE_NLOHMANN|ON|enable `nlohmann` json and modules dependent on it|
8485
|JPEG_HOME||path to existing libjpeg installation; if not provided, it will be built from source (implies ENABLE_JPEG=ON)|
8586
|J2K_HOME||path to existing openjpeg installation; if not provided, it will be built from source (implies ENABLE_J2K=ON)|
8687
|PCRE_HOME||path to existing pcre installation; if not provided, it will be built from source (implies ENABLE_PCRE=ON)|

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:

modules/drivers/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ option(ENABLE_JPEG "enable use of libjpeg" ON)
66
option(ENABLE_PCRE "enable PCRE library" ON)
77
option(ENABLE_UUID "enable UUID library" ON)
88
option(ENABLE_ZIP "enable zlib" ON)
9-
option(CODA_ENABLE_HDF5 "enable hdf5" ON)
9+
option(ENABLE_NLOHMANN "enable nlohmann" ON)
1010

1111
# Turn off all warnings; this is code we don't control.
1212
if (MSVC)
@@ -74,7 +74,6 @@ if (NOT CONAN_PACKAGE_NAME)
7474
endif()
7575
endif()
7676

77-
option(ENABLE_NLOHMANN "enable nlohmann" ON)
7877
if(ENABLE_NLOHMANN)
7978
add_subdirectory(nlohmann)
8079
endif()

0 commit comments

Comments
 (0)