DBA Data[Home] [Help]

PACKAGE: APPS.WF_LOG_PKG

Source


1 package WF_LOG_PKG AUTHID CURRENT_USER as
2 /* $Header: WFLOGPKS.pls 120.1.12000000.2 2007/07/02 21:21:24 vshanmug ship $ */
3 ------------------------------------------------------------------------------
4 /*
5 **      wf_debug_flag - Global Variable to hold whether debug on or off
6 **      ** May not be used when moved to FND Logging **
7 */
8 
9 WF_DEBUG_FLAG  	 BOOLEAN DEFAULT FALSE;
10 
11 /*
12 **	Level Global Variables - enables filtering of messages
13 */
14 LEVEL_UNEXPECTED CONSTANT NUMBER  := 6;
15 LEVEL_ERROR      CONSTANT NUMBER  := 5;
16 LEVEL_EXCEPTION  CONSTANT NUMBER  := 4;
17 LEVEL_EVENT      CONSTANT NUMBER  := 3;
18 LEVEL_PROCEDURE  CONSTANT NUMBER  := 2;
19 LEVEL_STATEMENT  CONSTANT NUMBER  := 1;
20 
21 /*
22 ** Table of start time of log calls stored by the module name
23 */
24 type wf_number_tab_t is table of number index by binary_integer;
25 g_start_times    wf_number_tab_t;
26 
27 ------------------------------------------------------------------------------
28 /*
29 ** Init - Initialise the Logging global variables to do standalone testing.
30 **        This will do the same work as wf_log_pkg.wf_debug_flag.
31 ** Change LOG_ENABLED to binary integer because JDBC doesn't support PL/SQL boolean.
32 ** 0 means false, 1 means true
33 */
34 procedure Init (
35    LOG_ENABLED  in binary_integer default 0,
36    LOG_FILENAME in varchar2 default NULL,
37    LOG_LEVEL    in number   default 5,
38    LOG_MODULE   in varchar2 default '%',
39    FND_USER_ID  in number   default 0,
40    FND_RESP_ID  in number   default -1,
41    FND_APPL_ID  in number   default -1
42 );
43 
44 ------------------------------------------------------------------------------
45 /*
46 ** SET_LEVEL - Change the PL/SQL Log Level
47 */
48 procedure SET_LEVEL (
49    LOG_LEVEL    in number   default 5
50 );
51 ------------------------------------------------------------------------------
52 /*
53 ** String - Procedure to output to screen log messages, only works if called
54 **	    from SQL*Plus and debug global variable set to TRUE
55 */
56 procedure String (
57   LOG_LEVEL	in number,
58   MODULE	in varchar2,
59   MESSAGE	in varchar2
60 );
61 ------------------------------------------------------------------------------
62 /*
63 ** Test - Function to verify if the logging is enabled for the given
64 **             Log Level
65 */
66 function Test (
67    LOG_LEVEL in number,
68    MODULE    in varchar2
69 )
70 return boolean;
71 
72 
73 /*
74 ** MESSAGE
75 **  Standalone :
76 **   Empty Implementation
77 **  Apps :
78 **   Wrapper to FND_LOG.MESSAGE
79 **   Writes a message to the log file if this level and module is enabled
80 **   This requires that the message was set previously with
81 **   WF_LOG_PKG.SET_NAME, WF_LOG_PKG.SET_TOKEN, etc.
82 **   The message is popped off the message dictionary stack, if POP_MESSAGE
83 **   is TRUE.  Pass FALSE for POP_MESSAGE if the message will also be
84 **   displayed to the user later.  If POP_MESSAGE isn't passed, the
85 **   message will not be popped off the stack, so it must be displayed
86 **   or explicitly cleared later on.
87 */
88 procedure MESSAGE (
89    LOG_LEVEL   in number,
90    MODULE      in varchar2,
91    POP_MESSAGE in boolean default null
92 );
93 
94 /*
95 ** SET_NAME
96 **  Standalone :
97 **   Empty Implementation
98 **  Apps :
99 **   Wrapper to FND_MESSAGE.SET_NAME
100 **   Sets the message name
101 */
102 procedure SET_NAME(
103    APPLICATION in varchar2,
104    NAME        in varchar2
105 );
106 
107 /*
108 ** SET_TOKEN
109 **  Standalone :
110 **   Empty Implementation
111 **  Apps :
112 **   Wrapper to FND_MESSAGE.SET_TOKEN
113 **   Defines a message token with a value
114 */
115 procedure SET_TOKEN (
116    TOKEN     in varchar2,
117    VALUE     in varchar2,
118    TRANSLATE in boolean default false
119 );
120 
121 ------------------------------------------------------------------------------
122 /*
123 ** String2 - Same as String procedure. This records the start time of the call
124 **           and prints the elapsed time when requested.
125 */
126 procedure String2 (
127   LOG_LEVEL     in number,
128   MODULE        in varchar2,
129   MESSAGE       in varchar2,
130   STARTS        in boolean default true
131 );
132 
133 end WF_LOG_PKG;