1 PACKAGE FND_OAM_DEBUG as
2 /* $Header: AFOAMDBGS.pls 120.1 2005/09/27 16:53 ilawler noship $ */
3
4 -------------------------
5 -- Public Constants/Types
6 -------------------------
7
8 --styles, translates to different devices
9 STYLE_SCREEN CONSTANT VARCHAR2(30) := 'SCREEN';
10 STYLE_FILE CONSTANT VARCHAR2(30) := 'FILE';
11 STYLE_FND_LOG CONSTANT VARCHAR2(30) := 'FND_LOG';
12
13 ---------------------------------
14 -- Public Procedures/Functions --
15 ---------------------------------
16
17 --Logging-related
18 -----------------
19
20 -- Initialize the package's log-related state. Should be called before any log
21 -- statements or ENABLE_STYLE_<type> statements.
22 -- Invariants:
23 -- None.
24 -- Parameters:
25 -- p_include_timestamp: Boolean indicating whether each log line should be prefaced by a timestamp
26 -- p_use_indentation: Boolean indicating whether each line should be indented based on package state.
27 -- p_start_indent_level: Starting indent level
28 -- Returns:
29 -- TRUE Success
30 -- FALSE Failure
31 FUNCTION INIT_LOG(p_include_timestamp IN BOOLEAN DEFAULT NULL,
32 p_use_indentation IN BOOLEAN DEFAULT NULL,
33 p_start_indent_level IN NUMBER DEFAULT NULL)
34 RETURN BOOLEAN;
35
36 -- Flushes all log styles, returns TRUE for success, FALSE for failure
37 FUNCTION FLUSH_LOG
38 RETURN BOOLEAN;
39
40 -- Closes all log styles and resets package state to defaults, returns TRUE for success, FALSE for failure
41 FUNCTION CLOSE_LOG
42 RETURN BOOLEAN;
43
44 -- Enables logging to the screen via dbms_output.
45 FUNCTION ENABLE_STYLE_SCREEN
46 RETURN BOOLEAN;
47
48 -- Enables logging to a file in the oracle_home of the database.
49 -- Invariants:
50 -- A call to INIT_LOG should have already occurred to init package state.
51 -- Parameters:
52 -- p_file_name_prefix: Prefix for the file name
53 -- p_include_unique_suffix: Boolean indicating whether the file name should be suffixed with a random, hopefully unique string.
54 -- This is useful when there are multiple threads and you want a log for each.
55 -- p_write_header: Boolean indicating whether a header timestamp should be written to the file after open.
56 -- Returns:
57 -- TRUE Success
58 -- FALSE Failure
59 FUNCTION ENABLE_STYLE_FILE(p_file_name_prefix IN VARCHAR2 DEFAULT NULL,
60 p_include_unique_suffix IN BOOLEAN DEFAULT NULL,
61 p_write_header IN BOOLEAN DEFAULT NULL)
62 RETURN BOOLEAN;
63
64 -- Enables logging using FND_LOG APIs
65 FUNCTION ENABLE_STYLE_FND_LOG
66 RETURN BOOLEAN;
67
68 -- Disables a given style, screen/file/fnd_log. returns true on success, false on failure.
69 FUNCTION DISABLE_STYLE(p_style IN VARCHAR2)
70 RETURN BOOLEAN;
71
72 -- Tests to see if logging is enabled for a given level/module
73 -- Invariants:
74 -- A call to INIT_LOG should have already occurred to init package state.
75 -- Parameters:
76 -- p_level: Level of string we wish to log, must be >= system log level.
77 -- p_module: Module of string we wish to log
78 -- Returns:
79 -- TRUE Logging Enabled
80 -- FALSE Logging Disabled
81 FUNCTION TEST(p_level IN NUMBER,
82 p_module IN VARCHAR2 DEFAULT NULL)
83 RETURN BOOLEAN;
84
85 -- Setter for fnd_oam_debug-controlled log level, overrides FND_LOG or any other predicate source.
86 PROCEDURE SET_LOG_LEVEL(p_level IN NUMBER);
87
88 -- Sets the indent level
89 PROCEDURE SET_INDENT_LEVEL(p_level IN NUMBER);
90
91 -- Logs a string with implicit level=1, module=NULL
92 PROCEDURE LOG(p_string IN VARCHAR2);
93
94 -- Logs a string with level p_level and module p_context.
95 PROCEDURE LOG(p_level IN NUMBER,
96 p_context IN VARCHAR2,
97 p_string IN VARCHAR2);
98
99 -- Logs a string with a forced, prefixed timestamp
100 PROCEDURE LOGSTAMP(p_string IN VARCHAR2);
101
102 END FND_OAM_DEBUG;