We use RAISE NOTICE to generate a notice message like we use the console.logs() on Javascript. The message can include placeholders (e.g., %) where you can insert values or variables.
Example:
CREATE OR REPLACE FUNCTION example_function() RETURNS void AS $$
BEGIN
-- Some code here
-- Raise a notice message
RAISE NOTICE 'This is a notice message: %', 'Additional data';
-- More code here
END;
$$ LANGUAGE plpgsql;