29: procedure entryPoint(p_procName IN VARCHAR2,
30: p_params IN param_tbl_t,
31: x_returnStatus out NOCOPY VARCHAR2) is
32: begin
33: x_returnStatus := fnd_api.g_ret_sts_success;
34: g_indentLevel := least(g_indentLevel + 1, g_maxIndentLevel);
35:
36: g_moduleTbl(nvl(g_moduleTbl.last, 0) + 1) := 'wip.plsql.' || p_procName;
37:
37:
38: write(p_msg => '[begin ' || p_procName || ']',
39: p_logLevel => wip_constants.full_logging,
40: x_returnStatus => x_returnStatus);
41: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
42: raise fnd_api.g_exc_unexpected_error;
43: end if;
44: for i in 1..p_params.count loop
45: write(p_msg => ' ' || p_params(i).paramName || ': ' || p_params(i).paramValue,
38: write(p_msg => '[begin ' || p_procName || ']',
39: p_logLevel => wip_constants.full_logging,
40: x_returnStatus => x_returnStatus);
41: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
42: raise fnd_api.g_exc_unexpected_error;
43: end if;
44: for i in 1..p_params.count loop
45: write(p_msg => ' ' || p_params(i).paramName || ': ' || p_params(i).paramValue,
46: p_logLevel => wip_constants.full_logging,
44: for i in 1..p_params.count loop
45: write(p_msg => ' ' || p_params(i).paramName || ': ' || p_params(i).paramValue,
46: p_logLevel => wip_constants.full_logging,
47: x_returnStatus => x_returnStatus);
48: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
49: raise fnd_api.g_exc_unexpected_error;
50: end if;
51: end loop;
52:
45: write(p_msg => ' ' || p_params(i).paramName || ': ' || p_params(i).paramValue,
46: p_logLevel => wip_constants.full_logging,
47: x_returnStatus => x_returnStatus);
48: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
49: raise fnd_api.g_exc_unexpected_error;
50: end if;
51: end loop;
52:
53: exception
59: p_procReturnStatus IN VARCHAR2,
60: p_msg IN VARCHAR2,
61: x_returnStatus out NOCOPY VARCHAR2) is
62: begin
63: x_returnStatus := fnd_api.g_ret_sts_success;
64:
65: write(p_msg => '[end ' || p_procName || ']',
66: p_logLevel => wip_constants.full_logging,
67: x_returnStatus => x_returnStatus);
64:
65: write(p_msg => '[end ' || p_procName || ']',
66: p_logLevel => wip_constants.full_logging,
67: x_returnStatus => x_returnStatus);
68: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
69: raise fnd_api.g_exc_unexpected_error;
70: end if;
71:
72: write(p_msg => ' return status: ' || p_procReturnStatus,
65: write(p_msg => '[end ' || p_procName || ']',
66: p_logLevel => wip_constants.full_logging,
67: x_returnStatus => x_returnStatus);
68: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
69: raise fnd_api.g_exc_unexpected_error;
70: end if;
71:
72: write(p_msg => ' return status: ' || p_procReturnStatus,
73: p_logLevel => wip_constants.full_logging,
71:
72: write(p_msg => ' return status: ' || p_procReturnStatus,
73: p_logLevel => wip_constants.full_logging,
74: x_returnStatus => x_returnStatus);
75: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
76: raise fnd_api.g_exc_unexpected_error;
77: end if;
78:
79: write(p_msg => ' info: ' || p_msg,
72: write(p_msg => ' return status: ' || p_procReturnStatus,
73: p_logLevel => wip_constants.full_logging,
74: x_returnStatus => x_returnStatus);
75: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
76: raise fnd_api.g_exc_unexpected_error;
77: end if;
78:
79: write(p_msg => ' info: ' || p_msg,
80: p_logLevel => wip_constants.full_logging,
78:
79: write(p_msg => ' info: ' || p_msg,
80: p_logLevel => wip_constants.full_logging,
81: x_returnStatus => x_returnStatus);
82: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
83: raise fnd_api.g_exc_unexpected_error;
84: end if;
85:
86: --this if should always be true
79: write(p_msg => ' info: ' || p_msg,
80: p_logLevel => wip_constants.full_logging,
81: x_returnStatus => x_returnStatus);
82: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
83: raise fnd_api.g_exc_unexpected_error;
84: end if;
85:
86: --this if should always be true
87: if(g_moduleTbl.last is not null) then
102: g_sessionID := -1;
103: g_indentLevel := 0;
104: g_moduleTbl.delete;
105:
106: x_returnStatus := fnd_api.g_ret_sts_success;
107: exception
108: when others then
109: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
110: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_logger',
105:
106: x_returnStatus := fnd_api.g_ret_sts_success;
107: exception
108: when others then
109: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
110: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_logger',
111: p_procedure_name => 'cleanUp',
112: p_error_text => SQLERRM);
113: end cleanUp;
117: x_returnStatus out NOCOPY VARCHAR2) is
118: l_msg VARCHAR2(2000);
119: l_module VARCHAR2(2000);
120: begin
121: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
122: if(g_sessionID < 0) then
123: init(x_returnStatus => x_returnStatus);
124: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
125: raise fnd_api.g_exc_unexpected_error;
120: begin
121: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
122: if(g_sessionID < 0) then
123: init(x_returnStatus => x_returnStatus);
124: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
125: raise fnd_api.g_exc_unexpected_error;
126: end if;
127: end if;
128: l_msg := 'Session ' || g_sessionID || ': ';
121: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
122: if(g_sessionID < 0) then
123: init(x_returnStatus => x_returnStatus);
124: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
125: raise fnd_api.g_exc_unexpected_error;
126: end if;
127: end if;
128: l_msg := 'Session ' || g_sessionID || ': ';
129: l_msg := lpad(l_msg, g_indentLevel * g_indentOffset + length(l_msg), ' ');
127: end if;
128: l_msg := 'Session ' || g_sessionID || ': ';
129: l_msg := lpad(l_msg, g_indentLevel * g_indentOffset + length(l_msg), ' ');
130: l_msg := l_msg || substr(p_msg, 0, g_maxMsgLen - length(l_msg));
131: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
132: if(g_moduleTbl.last is null) then
133: g_moduleTbl(1) := g_anonModule;
134: end if;
135:
166: module => g_moduleTbl(g_moduleTbl.last),
167: message => l_msg);
168: end if;
169:
170: x_returnStatus := fnd_api.g_ret_sts_success;
171: exception
172: when others then
173: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
174: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_logger',
169:
170: x_returnStatus := fnd_api.g_ret_sts_success;
171: exception
172: when others then
173: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
174: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_logger',
175: p_procedure_name => 'write',
176: p_error_text => SQLERRM);
177: end write;
177: end write;
178:
179: procedure init(x_returnStatus out NOCOPY VARCHAR2) is
180: begin
181: x_returnStatus := fnd_api.g_ret_sts_success;
182: g_indentLevel := 0;
183:
184: if(g_sessionID < 0) then
185: select wip_logging_session_s.nextval