diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25ce3dc..d8a588c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022, macos-13, ubuntu-20.04] + os: [windows-2022, macos-13, ubuntu-22.04] env: SIGNAL_ENV: production GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -44,12 +44,12 @@ jobs: uses: microsoft/setup-msbuild@v1.3.1 if: runner.os == 'Windows' - # - name: sed it - # if: runner.os == 'Windows' - # shell: bash - # run: | - # sed -i "s/target_compile_options(oxen-logging-warnings INTERFACE/#target_compile_options(oxen-logging-warnings INTERFACE/" libsession-util/external/oxen-libquic/external/oxen-logging/CMakeLists.txt - # cat libsession-util/external/oxen-libquic/external/oxen-logging/CMakeLists.txt + - name: sed it + if: runner.os == 'Windows' + shell: bash + run: | + sed -i "s/target_compile_options(oxen-logging-warnings INTERFACE/#target_compile_options(oxen-logging-warnings INTERFACE/" libsession-util/external/oxen-libquic/external/oxen-logging/CMakeLists.txt + cat libsession-util/external/oxen-libquic/external/oxen-logging/CMakeLists.txt - name: build libsession-util-nodejs shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f540ec..22174b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ SET(WITH_TESTS OFF) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +set(ENABLE_ONIONREQ OFF) # when building from a release of libsession on desktop, it complains that ios-cmake is not up to date # as it is not part of the archive. We actually don't care about it on session-desktop diff --git a/libsession-util b/libsession-util index 730c5b9..93da4d4 160000 --- a/libsession-util +++ b/libsession-util @@ -1 +1 @@ -Subproject commit 730c5b9a919263e569451e3d908a0c414404e0dc +Subproject commit 93da4d4aaa0ad6ad5cb286527b7d950f5b61741b diff --git a/src/base_config.hpp b/src/base_config.hpp index d99250e..e970936 100644 --- a/src/base_config.hpp +++ b/src/base_config.hpp @@ -9,6 +9,7 @@ #include #include "session/config/base.hpp" +#include "session/logging.hpp" #include "session/types.hpp" #include "utilities.hpp" @@ -106,6 +107,18 @@ class ConfigBaseImpl { Napi::Env env = info.Env(); + session::add_logger([env, class_name](auto msg) { + std::string toLog = + "libsession-util:" + std::string(class_name) + ": " + std::string(msg) + "\n"; + + Napi::Function consoleLog = env.Global() + .Get("console") + .As() + .Get("log") + .As(); + consoleLog.Call({Napi::String::New(env, toLog)}); + }); + return config; }); }