Skip to content

Commit d699c1f

Browse files
committed
Merge branch 'enable-logging-diag'
* Branch commit log: .pre-commit-config.yaml: fix whitespace .github/workflows/*.yml: untabify yaml ase/engine.cc: use diag() (not warning) to allow tests without audio output ase/logging.cc: support ASE_DEBUG={all|trace|diag} for logging Signed-off-by: Tim Janik <timj@gnu.org>
2 parents ee3bb88 + eaf20e5 commit d699c1f

5 files changed

Lines changed: 25 additions & 16 deletions

File tree

.github/workflows/pages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
name: Deploy mkdocs site to Pages
88

99
on:
10-
workflow_dispatch: # Allow to run this workflow manually from the Actions tab
11-
push: { branches: ["trunk"] } # Run on pushes targeting the default branch
10+
workflow_dispatch: # Allow to run this workflow manually from the Actions tab
11+
push: { branches: ["trunk"] } # Run on pushes targeting the default branch
1212
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1313
permissions: { contents: read, pages: write, id-token: write }
1414

@@ -23,7 +23,7 @@ jobs:
2323
container: { image: 'ghcr.io/tim-janik/anklang-ci:ci-latest', options: --user runner }
2424
steps:
2525
- { uses: actions/checkout@v4, with: { fetch-depth: 0 } }
26-
- run: git fetch -f --tags # Fix actions/checkout#290
26+
- run: git fetch -f --tags # Fix actions/checkout#290
2727
- uses: actions/configure-pages@v5
2828
- name: 'Configure build presets'
2929
run: |

.github/workflows/testing.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
container: { image: 'ghcr.io/tim-janik/anklang-ci:ci-latest', options: --user runner }
1717
steps:
1818
- { uses: actions/checkout@v4, with: { fetch-depth: 0 } }
19-
- run: git fetch -f --tags # Fix actions/checkout#290
19+
- run: git fetch -f --tags # Fix actions/checkout#290
2020
- run: |
2121
make -w dist
2222
mkdir /tmp/anklang && tar xf artifacts/anklang-*.tar.zst -C /tmp/anklang --strip-components=1
@@ -54,7 +54,7 @@ jobs:
5454
container: { image: 'ghcr.io/tim-janik/anklang-ci:ci-latest', options: --user runner }
5555
steps:
5656
- { uses: actions/checkout@v4, with: { fetch-depth: 0 } }
57-
- run: git fetch -f --tags # Fix actions/checkout#290
57+
- run: git fetch -f --tags # Fix actions/checkout#290
5858
- run: git describe --always --long
5959
- name: 'Configure build presets'
6060
run: |
@@ -81,11 +81,11 @@ jobs:
8181
# container: { image: 'ghcr.io/tim-janik/anklang-ci:arch-latest' }
8282
# steps:
8383
# - { uses: actions/checkout@v4, with: { fetch-depth: 0 } }
84-
# - run: git fetch -f --tags # Fix actions/checkout#290
84+
# - run: git fetch -f --tags # Fix actions/checkout#290
8585
# - run: git describe --always --long
8686
# - name: 'Configure build presets'
8787
# run: |
88-
# echo 'prefix=/' > config-defaults.mk ;# reset any previous config-defaults.mk
88+
# echo 'prefix=/' > config-defaults.mk ;# reset any previous config-defaults.mk
8989
# - name: 'Build Anklang'
9090
# run: |
9191
# make GCC_COLORS="" -j`nproc` all
@@ -103,13 +103,13 @@ jobs:
103103
CreateRelease:
104104
runs-on: ubuntu-latest
105105
needs: [ ReleaseArtifacts ]
106-
if: github.ref_type == 'tag' # https://docs.github.com/en/actions/reference/events-that-trigger-workflows
106+
if: github.ref_type == 'tag' # https://docs.github.com/en/actions/reference/events-that-trigger-workflows
107107
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
108-
permissions: { contents: write } # allow github.token to create a release
108+
permissions: { contents: write } # allow github.token to create a release
109109
env: { GH_TOKEN: "${{ github.token }}" }
110110
steps:
111111
- { uses: actions/checkout@v4, with: { fetch-depth: 0 } }
112-
- run: git fetch -f --tags # Fix actions/checkout#290
112+
- run: git fetch -f --tags # Fix actions/checkout#290
113113
- uses: actions/download-artifact@v4
114114
with: { path: ./artifacts, merge-multiple: true }
115115
- run: ls -alR artifacts/
@@ -122,7 +122,7 @@ jobs:
122122
runs-on: ubuntu-latest
123123
steps:
124124
- { uses: actions/checkout@v4, with: { fetch-depth: 0 } }
125-
- run: git fetch -f --tags # Fix actions/checkout#290
125+
- run: git fetch -f --tags # Fix actions/checkout#290
126126
- name: Check-Jobs
127127
run: |
128128
echo '${{ needs.ReleaseArtifacts.result }}' '${{ needs.CreateRelease.result }}' '${{ needs.NobleClangTidy.result }}'

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
22

33
# See https://pre-commit.com for more information
4-
default_stages: [pre-push] # only run on push
4+
default_stages: [pre-push] # only run on push
55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
77
rev: v6.0.0
@@ -33,7 +33,7 @@ repos:
3333
name: Check Unfinished Work
3434
entry: misc/check-unfinished.sh
3535
language: system
36-
types: [file] # Run for all file types
36+
types: [file] # Run for all file types
3737
pass_filenames: true
3838
exclude: |
3939
(?x)^(

ase/engine.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ AudioEngine::update_drivers (const String &pcm_name, uint latency_ms, const Stri
735735
PcmDriver::open (dset.pcm_name, Driver::WRITEONLY, Driver::WRITEONLY, pcm_config, &er);
736736
if (!dset.pcm_driver || er != 0) {
737737
dset.pcm_driver = dset.null_pcm_driver;
738-
warning ("Audio Driver: Failed to open audio device: %s: %s", dset.pcm_name, ase_error_blurb (er));
738+
diag ("Audio Driver: Failed to open audio device: %s: %s", dset.pcm_name, ase_error_blurb (er));
739739
const String errmsg = string_format ("# Audio I/O Error\n" "Failed to open audio device:\n" "%s:\n" "%s",
740740
dset.pcm_name, ase_error_blurb (er));
741741
engine_thread.queue_user_note ("driver.pcm", UserNote::CLEAR, errmsg);

ase/logging.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,17 @@ bool
168168
logging_configure (bool to_file, Logging level)
169169
{
170170
logging_level = level;
171-
if (logging_level < FATAL)
172-
logging_level = parse_log_level (rfind_debug_value (getenv_ase_debug(), "loglevel", ""), INFO);
171+
if (logging_level < FATAL) {
172+
// ASE_DEBUG={all|trace|diag|loglevel=<level>} for logging
173+
if (strcmp ("0", rfind_debug_value (getenv_ase_debug(), "all", "0")) != 0)
174+
logging_level = TRACE;
175+
else if (strcmp ("0", rfind_debug_value (getenv_ase_debug(), "trace", "0")) != 0)
176+
logging_level = TRACE;
177+
else if (strcmp ("0", rfind_debug_value (getenv_ase_debug(), "diag", "0")) != 0)
178+
logging_level = DIAG;
179+
else
180+
logging_level = parse_log_level (rfind_debug_value (getenv_ase_debug(), "loglevel", ""), INFO);
181+
}
173182
loging_setup();
174183
if (!to_file) {
175184
std::lock_guard<std::mutex> locker (logging_buffer_mutex);

0 commit comments

Comments
 (0)