Skip to content

Commit

Permalink
Added the TOUCH function to LOG$ which makes sure configuration is lo…
Browse files Browse the repository at this point in the history
…aded.
  • Loading branch information
Sergejs Vinniks committed Dec 12, 2018
1 parent 8911329 commit 44c8c98
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/packages/dbms_output_handler.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ CREATE OR REPLACE PACKAGE BODY dbms_output_handler IS
p_message IN VARCHAR2
) IS

v_line log$.STRING;

v_calls log$.t_call_stack;
v_values log$.t_call_values;

Expand All @@ -75,7 +77,7 @@ CREATE OR REPLACE PACKAGE BODY dbms_output_handler IS

BEGIN

DBMS_OUTPUT.PUT_LINE(
v_line :=
TO_CHAR(SYSTIMESTAMP, 'hh24:mi:ss.ff3') || ' [' ||
RPAD(
CASE p_level
Expand All @@ -88,22 +90,24 @@ CREATE OR REPLACE PACKAGE BODY dbms_output_handler IS
END,
7
) || '] ' ||
p_message
);
p_message;

IF p_level >= v_call_stack_level THEN

DBMS_OUTPUT.PUT_LINE(
v_line :=
v_line || CHR(10) ||
log$.format_call_stack(
p_options => v_call_stack_format_options
)
);
);

END IF;

DBMS_OUTPUT.PUT_LINE(v_line);

END;

BEGIN
log$.touch;
v_call_stack_format_options.first_line_indent := 'at: ';
v_call_stack_format_options.indent := ' ';
END;
5 changes: 5 additions & 0 deletions src/packages/log$.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ CREATE OR REPLACE PACKAGE BODY log$ IS

/* Initialization methods */

PROCEDURE touch IS
BEGIN
NULL;
END;

PROCEDURE reset IS
BEGIN

Expand Down
2 changes: 2 additions & 0 deletions src/packages/log$.pks
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ CREATE OR REPLACE PACKAGE log$ IS

/* Initilalization methods */

PROCEDURE touch;

PROCEDURE reset;

PROCEDURE init;
Expand Down

0 comments on commit 44c8c98

Please sign in to comment.