Skip to content

Commit eefb375

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 92f6925 + 00b3532 commit eefb375

31 files changed

+458
-86
lines changed

.github/workflows/intelllvm.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: intelllvm
2+
concurrency:
3+
group: ${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
5+
on:
6+
push:
7+
branches:
8+
- master
9+
paths-ignore:
10+
- '**.md'
11+
- 'docs/**'
12+
- 'scripts/**'
13+
pull_request:
14+
branches:
15+
- master
16+
paths-ignore:
17+
- '**.md'
18+
- 'docs/**'
19+
- 'scripts/**'
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
build_type: [ Debug, Release ]
27+
std: [ 17 ]
28+
with_tests: [ ON ]
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install Intel oneAPI DPC++ Compiler 2025.2.1
33+
run: |
34+
wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo tee /etc/apt/trusted.gpg.d/GPG-PUB-KEY-INTEL-SW-PRODUCTS.asc
35+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
36+
sudo apt-get update
37+
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp cmake make
38+
39+
- name: Setup Intel oneAPI environment
40+
shell: bash
41+
run: |
42+
source /opt/intel/oneapi/setvars.sh
43+
# Export Intel environment to GITHUB_ENV
44+
echo "CXX=icpx" >> $GITHUB_ENV
45+
echo "CC=icx" >> $GITHUB_ENV
46+
echo "PATH=$PATH" >> $GITHUB_ENV
47+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
48+
echo "LIBRARY_PATH=$LIBRARY_PATH" >> $GITHUB_ENV
49+
echo "CPATH=$CPATH" >> $GITHUB_ENV
50+
echo "ONEAPI_ROOT=$ONEAPI_ROOT" >> $GITHUB_ENV
51+
52+
- name: Verify compiler
53+
run: |
54+
echo "CXX=$CXX"
55+
$CXX --version
56+
57+
- name: Prepare build directory
58+
run: mkdir -p ${{ runner.workspace }}/build
59+
60+
- name: Configure
61+
shell: bash
62+
env:
63+
CXX: icpx
64+
run: |
65+
cd ${{ runner.workspace }}/build
66+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DQUILL_BUILD_TESTS=${{ matrix.with_tests }} -DQUILL_BUILD_EXAMPLES=ON -DQUILL_VERBOSE_MAKEFILE=ON $GITHUB_WORKSPACE
67+
68+
- name: Build
69+
run: |
70+
cd ${{ runner.workspace }}/build
71+
cmake --build . --config ${{ matrix.build_type }} --parallel $(nproc)
72+
73+
- name: Test
74+
env:
75+
CTEST_OUTPUT_ON_FAILURE: True
76+
run: |
77+
cd ${{ runner.workspace }}/build
78+
ctest --build-config ${{ matrix.build_type }} --parallel $(nproc) --output-on-failure

CHANGELOG.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- TBD
1+
- [v10.1.0](#v1010)
22
- [v10.0.1](#v1001)
33
- [v10.0.0](#v1000)
44
- [v9.0.3](#v903)
@@ -91,16 +91,22 @@
9191
- [v1.1.0](#v110)
9292
- [v1.0.0](#v100)
9393

94-
## TBD
94+
## v10.1.0
9595

96-
- Added unique prefixes to internal macro variables to prevent conflicts with user variable names in the same
97-
scope. ([#799](https://github.com/odygrd/quill/issues/799)
98-
- Added overflow check when doubling resync interval in `RdtscClock::resync()` to prevent potential UBSan
99-
warnings ([#809](https://github.com/odygrd/quill/issues/809)
100-
- Improved `Utility::to_hex` function
101-
- Fixed an issue where `BackendWorker::_exit` was always executed during destruction, even when the backend thread had already stopped
96+
- Fixed potential conflicts by adding unique prefixes to internal macro variables to prevent conflicts with user
97+
variable names in the same
98+
scope. ([#799](https://github.com/odygrd/quill/issues/799))
99+
- Fixed potential `UBSan` warnings by adding overflow check when doubling resync interval in
100+
`RdtscClock::resync()` ([#809](https://github.com/odygrd/quill/issues/809))
101+
- Minor improvements in `Utility::to_hex` function and `StringFromTime`
102+
- Fixed an issue where `BackendWorker::_exit` was always executed during destruction, even when the backend thread had
103+
already stopped ([#815](https://github.com/odygrd/quill/issues/815))
102104
- Fixed `RotatingFileSink` to correctly handle `FilenameAppendOption::StartDate` configuration ([#822](https://github.com/odygrd/quill/issues/822))
103-
105+
- Fixed unnecessary allocation caused by empty `std::vector` while `BackendWorker` is idle on
106+
Windows ([#827](https://github.com/odygrd/quill/issues/827))
107+
- Fixed `FileSink::open_mode` string comparison for file mode flags
108+
- Adjusted default `BackendOptions` values for broader system compatibility and typical usage patterns
109+
104110
## v10.0.1
105111

106112
- Fixed PatternFormatter test to work with any repository name instead of hardcoded `quill` ([#795](https://github.com/odygrd/quill/issues/795))

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "quill",
3-
version = "10.0.1",
3+
version = "10.1.0",
44
compatibility_level = 1,
55
)
66

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<a href="https://github.com/odygrd/quill/actions?query=workflow%3Awindows">
2626
<img src="https://img.shields.io/github/actions/workflow/status/odygrd/quill/windows.yml?branch=master&label=Windows&logoColor=blue&style=flat-square&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iODgiIHdpZHRoPSI4OCIgeG1sbnM6dj0iaHR0cHM6Ly92ZWN0YS5pby9uYW5vIj48cGF0aCBkPSJNMCAxMi40MDJsMzUuNjg3LTQuODYuMDE2IDM0LjQyMy0zNS42Ny4yMDN6bTM1LjY3IDMzLjUyOWwuMDI4IDM0LjQ1M0wuMDI4IDc1LjQ4LjAyNiA0NS43em00LjMyNi0zOS4wMjVMODcuMzE0IDB2NDEuNTI3bC00Ny4zMTguMzc2em00Ny4zMjkgMzkuMzQ5bC0uMDExIDQxLjM0LTQ3LjMxOC02LjY3OC0uMDY2LTM0LjczOXoiIGZpbGw9IiMwMGFkZWYiLz48L3N2Zz4=" alt="windows-ci" />
2727
</a>
28+
<a href="https://github.com/odygrd/quill/actions?query=workflow%3Aintelllvm">
29+
<img src="https://img.shields.io/github/actions/workflow/status/odygrd/quill/intelllvm.yml?branch=master&label=Intel%20LLVM&style=flat-square&logo=intel" alt="intel-llvm-ci" />
30+
</a>
2831
</div>
2932

3033
<div>

benchmarks/backend_throughput/quill_backend_throughput.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ int main()
1919
quill::BackendOptions backend_options;
2020
backend_options.cpu_affinity = 5;
2121
backend_options.sleep_duration = std::chrono::nanoseconds{0};
22-
22+
backend_options.log_timestamp_ordering_grace_period = std::chrono::microseconds{1};
23+
2324
// Start the logging backend thread and give it some tiem to init
2425
quill::Backend::start(backend_options);
2526

@@ -64,4 +65,4 @@ int main()
6465
total_iterations / delta_d / 1e6,
6566
std::chrono::duration_cast<std::chrono::milliseconds>(delta).count(), total_iterations)
6667
<< std::endl;
67-
}
68+
}

benchmarks/backend_throughput/quill_backend_throughput_no_buffering.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ int main()
2020
backend_options.cpu_affinity = 5;
2121
backend_options.transit_events_hard_limit = 1;
2222
backend_options.transit_events_soft_limit = 1;
23-
23+
backend_options.log_timestamp_ordering_grace_period = std::chrono::microseconds{1};
24+
2425
// Start the logging backend thread and give it some tiem to init
2526
quill::Backend::start(backend_options);
2627

@@ -67,4 +68,4 @@ int main()
6768
total_iterations / delta_d / 1e6,
6869
std::chrono::duration_cast<std::chrono::milliseconds>(delta).count(), total_iterations)
6970
<< std::endl;
70-
}
71+
}

docs/backend_options.rst

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,43 @@
33
Backend Options
44
===============
55

6-
The backend options allow you to customize the behavior of the backend thread and are applied at runtime. To utilize these options, you need to create an object and pass it when starting the backend thread. Most options come with default values, but they can be tailored to meet the specific needs of your application. Refer to :cpp:struct:`BackendOptions` for detailed information.
6+
The backend options allow you to customize the behavior of the backend thread and are applied at runtime. To utilize these options, you need to create an object and pass it when starting the backend thread. Most options come with carefully tuned default values for general use, but they can be adjusted to meet the specific performance and latency requirements of your application. Refer to :cpp:struct:`BackendOptions` for detailed information.
7+
8+
Example Usage
9+
-------------
710

811
For example, to pin the backend worker thread to a specific CPU, you can use the following code:
912

1013
.. literalinclude:: examples/quill_docs_example_backend_options.cpp
1114
:language: cpp
1215
:linenos:
16+
17+
Character Sanitization
18+
-----------------------
19+
20+
By default, Quill filters log messages to ensure they contain only printable characters before writing them to sinks. This safety feature converts non-printable characters (including non-ASCII characters like Chinese, Japanese, or other Unicode text) to their hexadecimal representation (e.g., ``\xE4\xB8\xAD`` for Chinese characters).
21+
22+
The default printable character range is limited to ASCII characters from space (``' '``) to tilde (``'~'``), plus newline (``'\n'``).
23+
24+
**Disabling Character Sanitization for UTF-8 Logging**
25+
26+
If you need to log UTF-8 or other non-ASCII text (such as Chinese, etc.), you can disable character sanitization:
27+
28+
.. code-block:: cpp
29+
30+
quill::BackendOptions backend_options;
31+
backend_options.check_printable_char = {}; // Disable sanitization
32+
quill::Backend::start(backend_options);
33+
34+
**Custom Character Filtering**
35+
36+
You can also define custom printable character rules:
37+
38+
.. code-block:: cpp
39+
40+
quill::BackendOptions backend_options;
41+
backend_options.check_printable_char = [](char c) {
42+
// Allow ASCII printable + newline + common UTF-8 byte ranges
43+
return (c >= ' ' && c <= '~') || (c == '\n') || (static_cast<unsigned char>(c) >= 128);
44+
};
45+
quill::Backend::start(backend_options);

docs/cheat_sheet.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Outputs:
190190

191191
Logging Strings Without Additional Copy
192192
---------------------------------------
193-
By default, the logger takes a deep copy of any string. To log an immutable string with a valid lifetime without copying, use ``quill::utility::StringRef``.
193+
By default, the logger takes a deep copy of any string for thread safety. To log an immutable string with a valid lifetime without copying (e.g., string literals, static strings), use ``quill::utility::StringRef``.
194194

195195
.. code:: cpp
196196
@@ -302,7 +302,7 @@ To log user-defined types, you need to define how they should be serialized or c
302302
- If the type is **not trivially copyable**, it should have both a **copy constructor** and a **move constructor**.
303303

304304
2. **Use DirectFormatCodec**
305-
Suitable for objects that are not safe to copy across threads or for cases where formatting occurs in the slow path. This method converts the object to a string immediately in the hot path using `fmt::format`.
305+
Suitable for objects that are not safe to copy across threads (e.g., contain raw pointers, references, or non-copyable resources). This method converts the object to a string immediately in the hot path using `fmt::format`, which increases hot-path latency.
306306

307307
3. **Implement a Custom Codec**
308308
For maximum flexibility, you can define a custom codec to specify exactly how the object should be serialized and deserialized.
@@ -480,7 +480,7 @@ Writing Custom Codec
480480
Serialising Non Trivially Copyable User Defined Types With Public Members
481481
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
482482

483-
Note that it is possible to pass STL types to ``compute_total_encoded_size``, ``encode_members``, and ``decode_members`` as long as the relevant header file from ``quill/std/`` for that type is included.
483+
Note that STL types can be used in custom codecs by passing them to ``compute_total_encoded_size``, ``encode_members``, and ``decode_members``, provided you include the relevant header from ``quill/std/`` for each STL type used.
484484

485485
.. code:: cpp
486486

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def configureDoxyfile(input_dir, output_dir):
3636
project = 'Quill'
3737
copyright = '2024, Odysseas Georgoudis'
3838
author = 'Odysseas Georgoudis'
39-
release = 'v10.0.1'
39+
release = 'v10.1.0'
4040

4141
# -- General configuration ---------------------------------------------------
4242
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

docs/filters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Each :cpp:class:`Sink` can be associated with one or multiple :cpp:class:`Filter
99

1010
By default, a logger sends all log messages to its ``Sinks``. Filters provide a way to intercept and selectively process log records before they are outputted.
1111

12-
A filter is implemented as a callable object that evaluates each log statement and returns a boolean value. This boolean value determines whether the log statement should be forwarded to the ``Sink`` or filtered out.
12+
A filter is implemented as a callable object that evaluates each log statement on the backend thread and returns a boolean value. When the filter returns ``true``, the log statement is forwarded to the ``Sink``; when ``false``, the log statement is discarded.
1313

1414
Filtering Logs with the Built-In Filter
1515
---------------------------------------

0 commit comments

Comments
 (0)