getting the output of delete statement in UDF in postgres
You can use the GET DIAGNOSTICS command for this purpose.  A quick example:

DO $$
DECLARE i integer; 
BEGIN
    DELETE FROM event1;
    GET DIAGNOSTICS i = ROW_COUNT;
    RAISE NOTICE 'DELETE %', i;
END;
$$;


For DELETE statements, the only useful variable is ROW_COUNT, for INSERTs there is also RESULT_OID.

Set the error level after the RAISE to your choice and set the logging configuration accordingly.