Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for logging at different levels by Wasm guest #41

Closed
anth0nyleung opened this issue Apr 20, 2022 · 1 comment
Closed

Add support for logging at different levels by Wasm guest #41

anth0nyleung opened this issue Apr 20, 2022 · 1 comment

Comments

@anth0nyleung
Copy link
Contributor

Currently we support minimal logging. If udf calls println!, it is logged with log level log and this could or could not show up on the client depending on the setting of client_min_messages.

CREATE OR REPLACE FUNCTION logging() RETURNS INTEGER
    IMMUTABLE STRICT
    LANGUAGE PLRUST AS
$$
    println!("print");
    eprintln!("eprint");
    Ok(Some(0))
$$;

postgres=# select logging();
LOG:  print

WARNING:  eprint

 logging 
---------
       0
(1 row)
postgres=#
postgres=# set client_min_messages = 'debug1';
SET
postgres=# select logging();
LOG:  print

WARNING:  eprint

 logging 
---------
       0
(1 row)

We can consider adding enhancement to support for logging at different levels

notice!('notice');
warning!('warning');
error!('error');
log!('log');
@Hoverbear
Copy link
Contributor

We don't think we're pushing WASM more for now, might revisit though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants