Skip to content

Commit e3d85a5

Browse files
committed
squashed many small commit messages for documentation and matrix/ci improvements
1 parent 095ed1c commit e3d85a5

12 files changed

+125
-117
lines changed

.github/workflows/buildAndRunTests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: ci/action verbose ctest script
2-
1+
name: ci/action ctest Ubuntu v3
32
on:
43
push:
54
paths-ignore:
65
- docs/**
76
- '**.md'
87
- '**.markdown'
8+
- '**.yml'
99
branches: [ master ]
1010
pull_request:
1111
paths-ignore:
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424

2525
- name: Print env
2626
run: |

.github/workflows/codeql-analysis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ on:
1717
- docs/**
1818
- '**.md'
1919
- '**.markdown'
20+
- '**.yml'
2021
branches: [ master ]
2122
pull_request:
2223
paths-ignore:
@@ -43,11 +44,11 @@ jobs:
4344

4445
steps:
4546
- name: Checkout repository
46-
uses: actions/checkout@v2
47+
uses: actions/checkout@v3
4748

4849
# Initializes the CodeQL tools for scanning.
4950
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v2
51+
uses: github/codeql-action/init@v3
5152
with:
5253
languages: ${{ matrix.language }}
5354
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +59,7 @@ jobs:
5859
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5960
# If this step fails, then you should remove it and run the build manually (see below)
6061
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v2
62+
uses: github/codeql-action/autobuild@v3
6263

6364
# ℹ️ Command-line programs to run using the OS shell.
6465
# 📚 https://git.io/JvXDl
@@ -72,4 +73,4 @@ jobs:
7273
# make release
7374

7475
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@v2
76+
uses: github/codeql-action/analyze@v3

.github/workflows/ctest.yml

+67-69
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,88 @@
1-
name: ci/action ctest
2-
1+
name: matrix (ubuntu, macos, windows) ctes
32
on:
43
push:
54
paths-ignore:
65
- docs/**
7-
- '**.md'
8-
- '**.markdown'
9-
branches: [ master ]
6+
- "**.md"
7+
- "**.markdown"
8+
branches:
9+
- master
1010
pull_request:
1111
paths-ignore:
1212
- docs/**
13-
- '**.md'
14-
- '**.markdown'
15-
branches: [ master ]
16-
13+
- "**.md"
14+
- "**.markdown"
15+
- '**.yml'
16+
branches:
17+
- master
1718
env:
18-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1919
BUILD_TYPE: Release
20-
21-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
22-
# if you have to do a quick fix and the CI is already running your new commit will kill already
23-
# going processes before starting new ones
2420
concurrency:
2521
group: ${{ github.workflow }}-${{ github.ref }}
2622
cancel-in-progress: true
27-
2823
jobs:
2924
build:
3025
strategy:
3126
matrix:
32-
os: [ubuntu-latest, macos-latest, windows-latest]
27+
os:
28+
- ubuntu-latest
29+
- macos-latest
30+
- windows-latest
3331
runs-on: ${{ matrix.os }}
34-
35-
# The CMake configure and build commands are platform agnostic and should work equally
36-
# well on Windows or Mac. You can convert this to a matrix build if you need
37-
# cross-platform coverage.
38-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
39-
#runs-on: ubuntu-latest
40-
#runs-on: ${{ matrix.os }}
41-
4232
steps:
43-
- uses: actions/checkout@v3
44-
45-
- name: Run Linux Build
46-
if: matrix.os == 'ubuntu-latest'
47-
run: echo "Ubuntu Latest" > release_ubuntu
48-
49-
- name: Run Mac Build
50-
if: matrix.os == 'macos-latest'
51-
run: echo "MacOS Latest" > release_mac
52-
53-
- name: Run Windows Build
54-
if: matrix.os == 'windows-latest'
55-
run: echo "Windows Latest" > release_windows
33+
# checkout full depth of history.
34+
- uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
5637

57-
- name: Create Build Environment
58-
# Some projects don't allow in-source building, so create a separate build directory
59-
# We'll use this as our working directory for all subsequent commands
60-
run: cmake -E make_directory ${{github.workspace}}/build
61-
62-
- name: Configure CMake
63-
# Use a bash shell so we can use the same syntax for environment variable
64-
# access regardless of the host operating system
65-
shell: bash
66-
working-directory: ${{github.workspace}}/build
67-
# Note the current convention is to use the -S and -B options here to specify source
68-
# and build directories, but this is only available with CMake 3.13 and higher.
69-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
70-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DADD_G3LOG_UNIT_TEST=ON
71-
72-
- name: Build
73-
working-directory: ${{github.workspace}}/build
74-
shell: bash
75-
# Execute the build. You can specify a specific target with "--target <NAME>"
76-
run: cmake --build . --config $BUILD_TYPE
38+
- name: Run Linux Build
39+
if: matrix.os == 'ubuntu-latest'
40+
run: echo "Ubuntu Latest" > release_ubuntu
41+
42+
- name: Run Mac Build
43+
if: matrix.os == 'macos-latest'
44+
run: echo "MacOS Latest" > release_mac
45+
46+
- name: Run Windows Build
47+
if: matrix.os == 'windows-latest'
48+
run: echo "Windows Latest" > release_windows
49+
50+
- name: Create Build Environment
51+
run: cmake -E make_directory ${{github.workspace}}/build
52+
53+
- name: Configure Linux/OSX CMake
54+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
55+
shell: bash
56+
working-directory: ${{github.workspace}}/build
57+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
58+
-DADD_G3LOG_UNIT_TEST=ON
7759

78-
- name: Test
79-
working-directory: ${{github.workspace}}/build
80-
shell: bash
81-
# Execute tests defined by the CMake configuration.
82-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
83-
run: ctest -C $BUILD_TYP
60+
- name: Configure Windows CMake
61+
if: matrix.os == 'windows-latest'
62+
shell: cmd
63+
working-directory: ${{github.workspace}}/build
64+
run: ls && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DADD_G3LOG_UNIT_TEST=ON ..
65+
66+
- name: Build Linux/OSx
67+
working-directory: ${{github.workspace}}/build
68+
shell: bash
69+
run: cmake --build . --config $BUILD_TYPE
8470

85-
- name: Fatal Exit Example
86-
working-directory: ${{github.workspace}}/build
87-
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
88-
shell: bash
89-
# hacky / crude and effective
90-
run: ./g3log-FATAL-sigsegv || true && echo -e "\n\n=======================\n\nverifying SIGSEGV existed in stackdump\n\n\n\n" && cat /tmp/g3log*FATAL*.log | grep "SIGSEGV"
71+
- name: Test
72+
working-directory: ${{github.workspace}}/build
73+
shell: bash
74+
run: ctest -C $BUILD_TYP
75+
76+
- name: Fatal Exit Example Linux/OSX
77+
working-directory: ${{github.workspace}}/build
78+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
79+
shell: bash
80+
run: ./g3log-FATAL-sigsegv || true && echo -e
81+
"\n\nverifying SIGSEGV existed in stackdump\n\n\n\n" && cat /tmp/*3log*FATAL*.log && cat /tmp/g3log*FATAL*.log | grep "SIGSEGV"
82+
83+
- name: Fatal Exit Example Windows
84+
working-directory: ${{github.workspace}}/build
85+
if: matrix.os == 'windows-latest'
86+
shell: bash
87+
run: ./Release/g3log-FATAL-sigsegv.exe || true && echo -e "\n\nverifying SIGSEGV - EXCEPTION_ACCESS_VIOLATION existed in
88+
stackdump\n\n\n\n" && cat *3log*FATAL*.log && cat *3log*FATAL*.log | grep "EXCEPTION_ACCESS_VIOLATION"

.github/workflows/docs.yml

-24
This file was deleted.

.github/workflows/documentation.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Locally you can try this out also with `mkdocs serve`
2+
# Remember if doing changes that github pages, need to deploy branch gh_pages
3+
# which points to root.
4+
name: Dockumentation Publish v2
5+
on:
6+
push:
7+
branches:
8+
- master
9+
permissions:
10+
contents: write
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Configure Git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24+
- uses: actions/cache@v4
25+
with:
26+
key: mkdocs-material-${{ env.cache_id }}
27+
path: .cache
28+
restore-keys: |
29+
mkdocs-material-
30+
- run: pip install mkdocs-material
31+
- run: mkdocs gh-deploy --force

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# New Code:
1+
# New Code
22
1. Please support all changed functionality with unit testing. A TDD approach usually leaves a cleaner end result than writing test afterwards
33

44

5-
# Issues:
5+
# Issues
66
1. Please explain your environment in the ticket. Frequently initialization issues due to not following best practices or the documentation are the causes.
77
Check the documentation and search previous issues before opening up a new one.
88
1. Don't be afraid of adding additional contexst of an old issue in case you think
99
this will improve things for the community going forward.
1010

1111

12-
# Community Driven:
13-
G3log is community driven. Be respectful. G3log is developed and maintained without financial support, being helpful and polite will move your request and input along faster.
12+
# Community Driven
13+
G3log is community driven. Be respectful. G3log is developed and maintained without financial support, being helpful and polite will move your request and input along faster.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
# Welcome to g3log
7-
### Use [kjellkod.github.io/g3log/](https://kjellkod.github.io/g3log/) for best reading / searching / navigating of g3log's documentation.
7+
### Use [kjellkod.github.io/g3log/](https://kjellkod.github.io/g3log/) for best reading / searching / navigating of g3log's documentation
88

99
G3log is an asynchronous logger with three main features:
1010
1. Intuitive `LOG(...)` API
@@ -13,22 +13,22 @@ G3log is an asynchronous logger with three main features:
1313

1414
The super quick introduction to g3log can be seen in the steps 1 - 9 below.
1515

16-
For more in-depth information please see the full usage description in [g3log_usage.md](docs/g3log_usage.md).If you want to understand better the internals of g3log, then plase look at the [API.md](docs/API.md) for both high-level and deep-dive insights.
16+
For more in-depth information please see the full usage description in [g3log_usage.md](docs/g3log_usage.md). If you want to understand better the internals of g3log, then plase look at the [API.md](docs/API.md) for both high-level and deep-dive insights.
1717

1818

1919
## Experiment and try-out g3log in Github Codespaces
2020
ref: [codespaces.md](docs/codespaces.md)
2121

2222

2323
## 1. Easy usage in files
24-
Avoid deep dependency injection complexity and instead get access to the logger as easy as
24+
Avoid deep dependency injection complexity and instead get access to the logger as easy as:
2525
```
2626
#include <g3log/g3log.hpp>
2727
```
2828

2929

3030
## 2. Access to streaming and print_f log call syntax
31-
Both streaming syntax `LOG` and print_f `LOGF` syntax are available.
31+
Both streaming syntax `LOG` and print_f `LOGF` syntax are available:
3232

3333
```
3434
LOGF(INFO, "Hi log %d", 123);

_config.yml

-1
This file was deleted.

docs/API.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[introduction](index.md) | [detailed information](g3log_usage.md) | [Configure & Build](building.md) | [**API description**](API.md) | [Custom log formatting](API_custom_formatting.md)
22

33
# High Level Description of g3log
4-
The `g3log` logger is an asynchronous, crash-safe logging library designed for C++ applications. It allows for logging messages to various sinks without blocking the main application thread. Below is a high-level overview of how the `g3log` logger works:
4+
The `g3log` logger is an asynchronous, crash-safe logging library designed for C++ applications. It allows for logging messages to various sinks without blocking the main application thread. Below is a high-level overview of how the `g3log` logger works.
55

66
## Asynchronous Logging
77
The logger operates on a separate thread, ensuring that the main application thread is not blocked by I/O operations when logging messages. This is achieved by using a background worker ([`LogWorker`](../src/g3log/logworker.hpp)) that queues log messages and processes them asynchronously.

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
G3log is an asynchronous logger with three main features:
77
1. Intuitive `LOG(...)` API
88
2. `Design-by-contract` `CHECK(...)` functionality
9-
3. Fatal crash handling for graceful shutdown of the logged process without loosing any log details up to the point of the crash.
9+
3. Fatal crash handling for graceful shutdown of the logged process without loosing any log details up to the point of the crash
1010

1111
The super quick introduction to g3log can be seen in the steps 1 - 9 below.
1212

example/main_sigsegv.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace example_fatal {
3636
LOGF(G3LOG_DEBUG, "ILLEGAL PRINTF_SYNTAX EXAMPLE. WILL GENERATE compiler warning.\n\nbadly formatted message:[Printf-type %s is the number 1 for many %s]", logging.c_str());
3737
}
3838

39-
// The function above 'tryToKillWithIllegalPrintout' IS system / compiler dependent. Older compilers sometimes did NOT generate a SIGSEGV
39+
// The function above 'tryToKillWithIllegalPrintout' IS system / compiler dependent. Older compilers sometimes did NOT generate a segmentation
4040
// fault as expected by the illegal printf-format usage. just in case we exit by zero division"
4141
void killByZeroDivision(int value) {
4242
int zero = 0; // trying to fool the compiler to automatically warn
@@ -45,7 +45,7 @@ namespace example_fatal {
4545

4646
void tryToKillWithAccessingIllegalPointer(std::unique_ptr<std::string> badStringPtr) {
4747
auto badPtr = std::move(badStringPtr);
48-
LOG(INFO) << "Function calls through a nullptr object will trigger SIGSEGV";
48+
LOG(INFO) << "Function calls through a nullptr object will trigger segmentation fault";
4949
badStringPtr->append("crashing");
5050
}
5151

mkdocs.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
site_name: G3log, an asynchronous "crash-safe" logger
2-
site_author: 'Kjell Hedström'
3-
docs_dir: docs/
4-
theme:
1+
site_name: TEST G3log, an asynchronous "crash-safe" logger
2+
site_author: 'Kjell Hedstrom'
3+
site_url: https://kjellkod.github.io/g3log/
4+
theme:
55
name: material
6+
7+
docs_dir: docs/
8+
69
nav:
710
- Introduction to G3log: index.md
811
- G3log usage: g3log.md

0 commit comments

Comments
 (0)