feat: print plugin logs to the server (#25812)
parent
db24a62658
commit
4bfd95d068
|
@ -3007,6 +3007,7 @@ dependencies = [
|
||||||
"influxdb3_internal_api",
|
"influxdb3_internal_api",
|
||||||
"influxdb3_wal",
|
"influxdb3_wal",
|
||||||
"iox_query_params",
|
"iox_query_params",
|
||||||
|
"observability_deps",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pyo3",
|
"pyo3",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|
|
@ -17,6 +17,7 @@ influxdb3_wal = { path = "../influxdb3_wal" }
|
||||||
influxdb3_catalog = {path = "../influxdb3_catalog"}
|
influxdb3_catalog = {path = "../influxdb3_catalog"}
|
||||||
influxdb3_internal_api = { path = "../influxdb3_internal_api" }
|
influxdb3_internal_api = { path = "../influxdb3_internal_api" }
|
||||||
iox_query_params.workspace = true
|
iox_query_params.workspace = true
|
||||||
|
observability_deps.workspace = true
|
||||||
parking_lot.workspace = true
|
parking_lot.workspace = true
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|
|
@ -11,6 +11,7 @@ use influxdb3_id::TableId;
|
||||||
use influxdb3_internal_api::query_executor::{QueryExecutor, QueryKind};
|
use influxdb3_internal_api::query_executor::{QueryExecutor, QueryKind};
|
||||||
use influxdb3_wal::{FieldData, WriteBatch};
|
use influxdb3_wal::{FieldData, WriteBatch};
|
||||||
use iox_query_params::StatementParams;
|
use iox_query_params::StatementParams;
|
||||||
|
use observability_deps::tracing::{error, info, warn};
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use pyo3::exceptions::PyValueError;
|
use pyo3::exceptions::PyValueError;
|
||||||
use pyo3::prelude::{PyAnyMethods, PyModule};
|
use pyo3::prelude::{PyAnyMethods, PyModule};
|
||||||
|
@ -67,6 +68,7 @@ impl std::fmt::Debug for LogLine {
|
||||||
#[pymethods]
|
#[pymethods]
|
||||||
impl PyPluginCallApi {
|
impl PyPluginCallApi {
|
||||||
fn info(&self, line: &str) -> PyResult<()> {
|
fn info(&self, line: &str) -> PyResult<()> {
|
||||||
|
info!("processing engine: {}", line);
|
||||||
self.return_state
|
self.return_state
|
||||||
.lock()
|
.lock()
|
||||||
.log_lines
|
.log_lines
|
||||||
|
@ -75,6 +77,7 @@ impl PyPluginCallApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn warn(&self, line: &str) -> PyResult<()> {
|
fn warn(&self, line: &str) -> PyResult<()> {
|
||||||
|
warn!("processing engine: {}", line);
|
||||||
self.return_state
|
self.return_state
|
||||||
.lock()
|
.lock()
|
||||||
.log_lines
|
.log_lines
|
||||||
|
@ -83,6 +86,7 @@ impl PyPluginCallApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn error(&self, line: &str) -> PyResult<()> {
|
fn error(&self, line: &str) -> PyResult<()> {
|
||||||
|
error!("processing engine: {}", line);
|
||||||
self.return_state
|
self.return_state
|
||||||
.lock()
|
.lock()
|
||||||
.log_lines
|
.log_lines
|
||||||
|
|
Loading…
Reference in New Issue