From ca04f01c901d3e12619c63b0ddafa2d73ebd0661 Mon Sep 17 00:00:00 2001 From: Kevin Zimmerman <4733573+kczimm@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:26:03 -0500 Subject: [PATCH] make Python logging fn public --- pgml-extension/src/bindings/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgml-extension/src/bindings/mod.rs b/pgml-extension/src/bindings/mod.rs index 3cae47316..294e0fe3a 100644 --- a/pgml-extension/src/bindings/mod.rs +++ b/pgml-extension/src/bindings/mod.rs @@ -8,7 +8,7 @@ use pyo3::{pyfunction, PyResult, Python}; use crate::orm::*; #[pyfunction] -fn r_insert_logs(project_id: i64, model_id: i64, logs: String) -> PyResult { +pub fn r_insert_logs(project_id: i64, model_id: i64, logs: String) -> PyResult { let id_value = Spi::get_one_with_args::( "INSERT INTO pgml.logs (project_id, model_id, logs) VALUES ($1, $2, $3::JSONB) RETURNING id;", vec![ @@ -23,7 +23,7 @@ fn r_insert_logs(project_id: i64, model_id: i64, logs: String) -> PyResult PyResult { +pub fn r_log(level: String, message: String) -> PyResult { match level.as_str() { "info" => info!("{}", message), "warning" => warning!("{}", message),