Skip to content

Commit

Permalink
Merge pull request #138 from samansmink/bump-duckdb-new-logger
Browse files Browse the repository at this point in the history
new logger, bump duckdb to prerelease
  • Loading branch information
samansmink authored Jan 21, 2025
2 parents 7f8cc36 + 9888c88 commit f9367ef
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Build extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
with:
duckdb_version: main
duckdb_version: v1.2-histrionicus
ci_tools_version: main
extension_name: delta
enable_rust: true
Expand All @@ -30,6 +30,6 @@ jobs:
secrets: inherit
with:
extension_name: delta
duckdb_version: main
duckdb_version: v1.2-histrionicus
ci_tools_version: main
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools;windows_amd64_mingw;linux_amd64_musl'
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 197 files
2 changes: 1 addition & 1 deletion extension-ci-tools
27 changes: 14 additions & 13 deletions src/delta_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,24 +643,25 @@ void LoggerCallback::Initialize(DatabaseInstance &db_p) {
}
}

static string ConvertLogMessage(ffi::Event event) {
auto log_type = KernelUtils::FromDeltaString(event.target);
auto message = KernelUtils::FromDeltaString(event.message);
auto file = KernelUtils::FromDeltaString(event.file);
string constructed_log_message;
if (!file.empty()) {
constructed_log_message = StringUtil::Format("[%s] %s@%u : %s ", log_type, file, event.line, message);
} else {
constructed_log_message = message;
}

return constructed_log_message;
}
void LoggerCallback::CallbackEvent(ffi::Event event) {
auto &instance = GetInstance();
auto db_locked = instance.db.lock();
if (db_locked) {
auto transformed_log_level = GetDuckDBLogLevel(event.level);
string constructed_log_message;
Logger::Log("delta.Kernel", *db_locked, transformed_log_level, [&]() {
auto log_type = KernelUtils::FromDeltaString(event.target);
auto message = KernelUtils::FromDeltaString(event.message);
auto file = KernelUtils::FromDeltaString(event.file);
if (!file.empty()) {
constructed_log_message = StringUtil::Format("[%s] %s@%u : %s ", log_type, file, event.line, message);
} else {
constructed_log_message = message;
}

return constructed_log_message.c_str();
});
DUCKDB_LOG( *db_locked, "delta.Kernel", transformed_log_level, ConvertLogMessage(event));
}
}

Expand Down

0 comments on commit f9367ef

Please sign in to comment.