[instrument] Move traces to debug (#2653)

This commit is contained in:
Salvador Girones Gil 2023-09-08 20:21:25 +02:00 committed by GitHub
parent 93d82146fb
commit 91cc18c411
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View file

@ -169,7 +169,7 @@ impl<'a> Executor<'a> {
opt.set_db(Some(db.into())); opt.set_db(Some(db.into()));
} }
#[instrument(name = "executor", skip_all)] #[instrument(level = "debug", name = "executor", skip_all)]
pub async fn execute( pub async fn execute(
&mut self, &mut self,
mut ctx: Context<'_>, mut ctx: Context<'_>,

View file

@ -749,7 +749,7 @@ impl Datastore {
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```
#[instrument(skip_all)] #[instrument(level = "debug", skip_all)]
pub async fn execute( pub async fn execute(
&self, &self,
txt: &str, txt: &str,
@ -779,7 +779,7 @@ impl Datastore {
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```
#[instrument(skip_all)] #[instrument(level = "debug", skip_all)]
pub async fn process( pub async fn process(
&self, &self,
ast: Query, ast: Query,
@ -844,7 +844,7 @@ impl Datastore {
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```
#[instrument(skip_all)] #[instrument(level = "debug", skip_all)]
pub async fn compute( pub async fn compute(
&self, &self,
val: Value, val: Value,
@ -920,13 +920,13 @@ impl Datastore {
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```
#[instrument(skip_all)] #[instrument(level = "debug", skip_all)]
pub fn notifications(&self) -> Option<Receiver<Notification>> { pub fn notifications(&self) -> Option<Receiver<Notification>> {
self.notification_channel.as_ref().map(|v| v.1.clone()) self.notification_channel.as_ref().map(|v| v.1.clone())
} }
/// Performs a full database export as SQL /// Performs a full database export as SQL
#[instrument(skip(self, sess, chn))] #[instrument(level = "debug", skip(self, sess, chn))]
pub async fn export( pub async fn export(
&self, &self,
sess: &Session, sess: &Session,
@ -951,7 +951,7 @@ impl Datastore {
} }
/// Performs a database import from SQL /// Performs a database import from SQL
#[instrument(skip(self, sess, sql))] #[instrument(level = "debug", skip(self, sess, sql))]
pub async fn import(&self, sql: &str, sess: &Session) -> Result<Vec<Response>, Error> { pub async fn import(&self, sql: &str, sess: &Session) -> Result<Vec<Response>, Error> {
// Skip auth for Anonymous users if auth is disabled // Skip auth for Anonymous users if auth is disabled
let skip_auth = !self.is_auth_enabled() && sess.au.is_anon(); let skip_auth = !self.is_auth_enabled() && sess.au.is_anon();

View file

@ -19,37 +19,37 @@ use tracing::instrument;
/// ///
/// If you encounter this limit and believe that it should be increased, /// If you encounter this limit and believe that it should be increased,
/// please [open an issue](https://github.com/surrealdb/surrealdb/issues)! /// please [open an issue](https://github.com/surrealdb/surrealdb/issues)!
#[instrument(name = "parser", skip_all, fields(length = input.len()))] #[instrument(level = "debug", name = "parser", skip_all, fields(length = input.len()))]
pub fn parse(input: &str) -> Result<Query, Error> { pub fn parse(input: &str) -> Result<Query, Error> {
parse_impl(input, query) parse_impl(input, query)
} }
/// Parses a SurrealQL [`Thing`] /// Parses a SurrealQL [`Thing`]
#[instrument(name = "parser", skip_all, fields(length = input.len()))] #[instrument(level = "debug", name = "parser", skip_all, fields(length = input.len()))]
pub fn thing(input: &str) -> Result<Thing, Error> { pub fn thing(input: &str) -> Result<Thing, Error> {
parse_impl(input, super::thing::thing) parse_impl(input, super::thing::thing)
} }
/// Parses a SurrealQL [`Idiom`] /// Parses a SurrealQL [`Idiom`]
#[instrument(name = "parser", skip_all, fields(length = input.len()))] #[instrument(level = "debug", name = "parser", skip_all, fields(length = input.len()))]
pub fn idiom(input: &str) -> Result<Idiom, Error> { pub fn idiom(input: &str) -> Result<Idiom, Error> {
parse_impl(input, super::idiom::plain) parse_impl(input, super::idiom::plain)
} }
/// Parses a SurrealQL [`Value`]. /// Parses a SurrealQL [`Value`].
#[instrument(name = "parser", skip_all, fields(length = input.len()))] #[instrument(level = "debug", name = "parser", skip_all, fields(length = input.len()))]
pub fn value(input: &str) -> Result<Value, Error> { pub fn value(input: &str) -> Result<Value, Error> {
parse_impl(input, super::value::value) parse_impl(input, super::value::value)
} }
/// Parses a SurrealQL Subquery [`Subquery`] /// Parses a SurrealQL Subquery [`Subquery`]
#[instrument(name = "parser", skip_all, fields(length = input.len()))] #[instrument(level = "debug", name = "parser", skip_all, fields(length = input.len()))]
pub fn subquery(input: &str) -> Result<Subquery, Error> { pub fn subquery(input: &str) -> Result<Subquery, Error> {
parse_impl(input, super::subquery::subquery) parse_impl(input, super::subquery::subquery)
} }
/// Parses JSON into an inert SurrealQL [`Value`] /// Parses JSON into an inert SurrealQL [`Value`]
#[instrument(name = "parser", skip_all, fields(length = input.len()))] #[instrument(level = "debug", name = "parser", skip_all, fields(length = input.len()))]
pub fn json(input: &str) -> Result<Value, Error> { pub fn json(input: &str) -> Result<Value, Error> {
parse_impl(input.trim(), super::value::json) parse_impl(input.trim(), super::value::json)
} }