-
Notifications
You must be signed in to change notification settings - Fork 1
packages tree.log_action
Jan Kvetina edited this page Sep 27, 2020
·
2 revisions
Repository spec: tree.log_action
,
body: tree.log_action
The function/procedure is especially useful in long modules. You can think about it as an inner tree.log_module
.
It allows you to store passed in_action
name in logs.action_name
column with optional 8 arguments.
All following tree
calls will be linked to this action (logs.log_parent
) instead of last tree.log_module
call.
FUNCTION log_action (
in_action logs.action_name%TYPE,
in_arg1 logs.arguments%TYPE := NULL,
in_arg2 logs.arguments%TYPE := NULL,
in_arg3 logs.arguments%TYPE := NULL,
in_arg4 logs.arguments%TYPE := NULL,
in_arg5 logs.arguments%TYPE := NULL,
in_arg6 logs.arguments%TYPE := NULL,
in_arg7 logs.arguments%TYPE := NULL,
in_arg8 logs.arguments%TYPE := NULL
)
RETURN logs.log_id%TYPE;
Show code (19 lines)
FUNCTION log_action (
in_action logs.action_name%TYPE,
in_arg1 logs.arguments%TYPE := NULL,
in_arg2 logs.arguments%TYPE := NULL,
in_arg3 logs.arguments%TYPE := NULL,
in_arg4 logs.arguments%TYPE := NULL,
in_arg5 logs.arguments%TYPE := NULL,
in_arg6 logs.arguments%TYPE := NULL,
in_arg7 logs.arguments%TYPE := NULL,
in_arg8 logs.arguments%TYPE := NULL
)
RETURN logs.log_id%TYPE AS
BEGIN
RETURN tree.log__ (
in_action_name => in_action,
in_flag => tree.flag_action,
in_arguments => tree.get_arguments(in_arg1, in_arg2, in_arg3, in_arg4, in_arg5, in_arg6, in_arg7, in_arg8)
);
END;
PROCEDURE your_procedure AS
BEGIN
tree.log_action();
tree.log_action('1ST_PART'); -- split long procedure into several actions
-- your code
NULL;
tree.log_action('2ND_PART');
-- your code
NULL;
tree.log_action('3RD_PART');
-- your code
NULL;
END;