Skip to content
Merged

Log #730

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
submodules: true

# Runs a set of commands using the runners shell
- name: Select Xcode to 16.4
run:
sudo xcode-select --switch /Applications/Xcode_16.4.app
- name: Run mac tests
run:
xcodebuild
Expand Down
2 changes: 1 addition & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down Expand Up @@ -78,6 +78,6 @@ let package = Package(
]
),
],
cLanguageStandard: .gnu18,
cLanguageStandard: .gnu2x,
cxxLanguageStandard: .gnucxx2b
)
11 changes: 4 additions & 7 deletions Sources/audio-engine/include/audio-engine/utils/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@

#include <audio-engine/utils/debug.h>

#if DEBUG

#include <iostream>
#include <atomic>

using namespace yas;

namespace yas::audio {
static bool _log_enabled = false;
static std::atomic<bool> _log_enabled;
}

void audio::set_log_enabled(bool const enabled) {
_log_enabled = enabled;
_log_enabled.store(enabled);
}

void audio::log(std::string const &log) {
if (_log_enabled) {
if (_log_enabled.load()) {
std::cout << log << std::endl;
}
}

#endif
9 changes: 0 additions & 9 deletions Sources/audio-engine/include/audio-engine/utils/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#pragma once

#if DEBUG

#include <string>

namespace yas::audio {
Expand All @@ -15,10 +13,3 @@ void log(std::string const &);

#define yas_audio_set_log_enabled(__v) yas::audio::set_log_enabled(__v)
#define yas_audio_log(__v) yas::audio::log(__v)

#else

#define yas_audio_set_log_enabled(__v)
#define yas_audio_log(__v)

#endif
4 changes: 0 additions & 4 deletions Tests/audio-engine-tests/audio_basics_tests/debug_tests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#import <XCTest/XCTest.h>
#import "../test_utils.h"

#if DEBUG

@interface debug_tests : XCTestCase

@end
Expand All @@ -22,5 +20,3 @@ - (void)test_debug_log {
}

@end

#endif