-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathloggerutil.pks
66 lines (60 loc) · 2.76 KB
/
loggerutil.pks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
create or replace package loggerutil is
--==
--== Generate a Template for a given
--== procedure or function.
--== The template will include references
--== to LOGGER
--==
--== Prerequisites
--== The declaration of the Procedure or Function needs
--== to be available, i.e. it needs to be in the package
--== specification. It can't be a private.
--==
--== When using the default templates:
--== The package where the procedure is going to
--== be placed will need to have a global constant:
--== * g_package constant varchar2(31) := $$plsql_unit || '.';
--==
--== Template depends on DBMS_OTUPUT, therefore
--== Serveroutput needs to be turned on
--== In SQL*Plus:
--== * set serveroutput on format wrapped
--==
--== Usage
--== exec loggerutil.template ('package.procedure')
--== or
--== exec loggerutil.template ('package.function')
--==
--== 2015-02-26: Alex Nuijten Initial Creation
--== 2015-04-10: Alex Nuijten Renamed pacakge to loggerutil
--== 2015-04-15: Alex Nuijten Parse custom layout for template
--== removed p_standalone argument
--== 2015-04-26: Alex Nuijten Added procedures to set/reset
--== Custom Templates.
--== Dependencies:
--== Issue #103 must be implemented in Logger
--== (Logger Version 3.1.0)
--== 2015-04-30: Alex Nuijten Procedures to create/reset custom templates
--== 2016-10-25: Alex Nuijten Set and Reset Client Info Procedures
procedure template (p_procedure in varchar2);
--== Resets the Default Templates to the default setting
procedure reset_default_templates;
--== Create a custom template for (P)rocedure or (F)unction
--== Currently the template cannot exceed 255 characters, this
--== is caused by the limitation of the LOGGER_PREFS table
procedure set_custom_template (p_type in varchar2 -- P or F
,p_template in varchar2
);
--== When multiple developers use the same DB-schema
--== to develop a common code base, logger data from one
--== developer will quickly intermingle with other developer
--== logger data making it difficult to determine the data of interest
--== Using the set_client_info procedure allows you to set a specific
--== name in the logger table, making it easier to keep track of your data
procedure set_client_info (p_client_info in varchar2);
--== The reset_client_info procedure will restore the client info
--== to the original value
procedure reset_client_info;
end loggerutil;
/
show error