9: Description: See package specification.
10:
11: Change List
12: ----------
13: SuSivasu 24-OCT-2005 Carry out the check for the fnd log is enabled
14: before calling the fnd_log.string as this procedure
15: does the same check.
16: dkerr 17-FEB-2005 4192532 : truncate procedure_name parameter
17: at 128 characters.
10:
11: Change List
12: ----------
13: SuSivasu 24-OCT-2005 Carry out the check for the fnd log is enabled
14: before calling the fnd_log.string as this procedure
15: does the same check.
16: dkerr 17-FEB-2005 4192532 : truncate procedure_name parameter
17: at 128 characters.
18: nbristow 28-JAN-2005 Added PAY_LOG option to dump to the
377: l_caller varchar2(100);
378: begin
379:
380: --
381: --Optimize for fnd_log - uncomment if required
382: --
383: if fnd_log.g_current_runtime_level <= fnd_log.level_statement
384: then
385: --
379:
380: --
381: --Optimize for fnd_log - uncomment if required
382: --
383: if fnd_log.g_current_runtime_level <= fnd_log.level_statement
384: then
385: --
386:
387: who_called_me(l_caller,4);
386:
387: who_called_me(l_caller,4);
388:
389: -- A couple of modules call hr_trace('') in order to separate groups of
390: -- related trace() calls. As it stands fnd_log.string won't accept a
391: -- null value but instead raises an ORA-1400 with no fnd_message
392: -- context back to forms. fnd_log.string will accept a ' ' however
393: -- it seems risky to leave that in case the routine rtrims. For now
394: -- we pass a '.' and may file bug.
388:
389: -- A couple of modules call hr_trace('') in order to separate groups of
390: -- related trace() calls. As it stands fnd_log.string won't accept a
391: -- null value but instead raises an ORA-1400 with no fnd_message
392: -- context back to forms. fnd_log.string will accept a ' ' however
393: -- it seems risky to leave that in case the routine rtrims. For now
394: -- we pass a '.' and may file bug.
395:
396: fnd_log.string(fnd_log.level_statement,
392: -- context back to forms. fnd_log.string will accept a ' ' however
393: -- it seems risky to leave that in case the routine rtrims. For now
394: -- we pass a '.' and may file bug.
395:
396: fnd_log.string(fnd_log.level_statement,
397: lower('per.plsql.'||l_caller),
398: nvl(trace_data,'.'));
399: --
400: --Optimize for fnd_log - uncomment if required
396: fnd_log.string(fnd_log.level_statement,
397: lower('per.plsql.'||l_caller),
398: nvl(trace_data,'.'));
399: --
400: --Optimize for fnd_log - uncomment if required
401: --
402: end if;
403: --
404:
440: procedure trace (trace_data in varchar2) is
441: pragma autonomous_transaction ;
442: begin
443:
444: if fnd_log.g_current_runtime_level > fnd_log.level_statement
445: and NOT hr_utility.g_trace_on
446: then
447: return ;
448: else
665: PROCEDURE set_location (procedure_name IN VARCHAR2, stage IN NUMBER) IS
666: -- sub-procedure for AOL Logging
667: PROCEDURE set_location_trace IS
668: BEGIN
669: if fnd_log.g_current_runtime_level<=fnd_log.level_procedure then
670:
671: --
672: -- 4192532 Callers to set_location may be passing in very long
673: -- text strings for the procedure_name param. In these cases the
679: := substr(LTRIM(procedure_name),1,128);
680:
681: if SUBSTR(hr_utility.g_error_in_procedure_aol,1,10)
682: ='Entering: ' then
683: fnd_log.string(fnd_log.level_procedure,'per.plsql.'
684: ||LTRIM(SUBSTR(hr_utility.g_error_in_procedure_aol,11))
685: ||'.entering',to_char(stage));
686: elsif SUBSTR(hr_utility.g_error_in_procedure_aol,1,9)
687: ='Leaving: ' then
684: ||LTRIM(SUBSTR(hr_utility.g_error_in_procedure_aol,11))
685: ||'.entering',to_char(stage));
686: elsif SUBSTR(hr_utility.g_error_in_procedure_aol,1,9)
687: ='Leaving: ' then
688: fnd_log.string(fnd_log.level_procedure,'per.plsql.'
689: ||LTRIM(SUBSTR(hr_utility.g_error_in_procedure_aol,10))
690: ||'.leaving',to_char(stage));
691: elsif fnd_log.g_current_runtime_level <=fnd_log.level_statement then
692: hr_utility.g_error_stage_aol := TO_CHAR(stage);
687: ='Leaving: ' then
688: fnd_log.string(fnd_log.level_procedure,'per.plsql.'
689: ||LTRIM(SUBSTR(hr_utility.g_error_in_procedure_aol,10))
690: ||'.leaving',to_char(stage));
691: elsif fnd_log.g_current_runtime_level <=fnd_log.level_statement then
692: hr_utility.g_error_stage_aol := TO_CHAR(stage);
693: fnd_log.string(fnd_log.level_statement,
694: 'per.plsql.'||hr_utility.g_error_in_procedure_aol
695: ||'.'||hr_utility.g_error_stage_aol,
689: ||LTRIM(SUBSTR(hr_utility.g_error_in_procedure_aol,10))
690: ||'.leaving',to_char(stage));
691: elsif fnd_log.g_current_runtime_level <=fnd_log.level_statement then
692: hr_utility.g_error_stage_aol := TO_CHAR(stage);
693: fnd_log.string(fnd_log.level_statement,
694: 'per.plsql.'||hr_utility.g_error_in_procedure_aol
695: ||'.'||hr_utility.g_error_stage_aol,
696: hr_utility.g_error_stage_aol);
697: end if;
706: end if;
707: END set_location_trace;
708: BEGIN
709: -- Check for Logging
710: if fnd_log.g_current_runtime_level>fnd_log.level_procedure
711: and NOT hr_utility.g_trace_on then
712: RETURN;
713: else
714: set_location_trace;
1160: -- 13-MAY-2002 Check for AOL logging being enabled.
1161: -- replicates logic of trace() so that trace_local() can
1162: -- be called directly.
1163: --
1164: retval := (fnd_log.g_current_runtime_level = 1) or hr_utility.g_trace_on ;
1165:
1166: if (retval) then
1167: trace_local(trace_data) ;
1168: end if;
1304: ,p_label IN VARCHAR2
1305: ,p_message IN VARCHAR2 default null ) IS
1306: PROCEDURE set_location_trace IS
1307: BEGIN
1308: if fnd_log.g_current_runtime_level<=fnd_log.level_statement then
1309: fnd_log.string(fnd_log.level_statement,lower(p_product||'.plsql.'
1310: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1311: end if;
1312: if hr_utility.g_trace_on THEN
1305: ,p_message IN VARCHAR2 default null ) IS
1306: PROCEDURE set_location_trace IS
1307: BEGIN
1308: if fnd_log.g_current_runtime_level<=fnd_log.level_statement then
1309: fnd_log.string(fnd_log.level_statement,lower(p_product||'.plsql.'
1310: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1311: end if;
1312: if hr_utility.g_trace_on THEN
1313: hr_utility.g_error_stage := p_label;
1316: end if;
1317: END set_location_trace;
1318: BEGIN
1319: -- Check for Logging
1320: if fnd_log.g_current_runtime_level>fnd_log.level_statement
1321: and NOT hr_utility.g_trace_on then
1322: RETURN;
1323: else
1324: set_location_trace;
1373: ,p_label IN VARCHAR2
1374: ,p_message IN VARCHAR2 default null ) IS
1375: PROCEDURE set_location_trace IS
1376: BEGIN
1377: if fnd_log.g_current_runtime_level<=fnd_log.level_procedure then
1378: fnd_log.string(fnd_log.level_procedure,lower(p_product||'.plsql.'
1379: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1380: end if;
1381: if hr_utility.g_trace_on THEN
1374: ,p_message IN VARCHAR2 default null ) IS
1375: PROCEDURE set_location_trace IS
1376: BEGIN
1377: if fnd_log.g_current_runtime_level<=fnd_log.level_procedure then
1378: fnd_log.string(fnd_log.level_procedure,lower(p_product||'.plsql.'
1379: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1380: end if;
1381: if hr_utility.g_trace_on THEN
1382: hr_utility.g_error_stage := p_label;
1385: end if;
1386: END set_location_trace;
1387: BEGIN
1388: -- Check for Logging
1389: if fnd_log.g_current_runtime_level>fnd_log.level_procedure
1390: and NOT hr_utility.g_trace_on then
1391: RETURN;
1392: else
1393: set_location_trace;
1443: ,p_label IN VARCHAR2
1444: ,p_message IN VARCHAR2 default null ) IS
1445: PROCEDURE set_location_trace IS
1446: BEGIN
1447: if fnd_log.g_current_runtime_level<=fnd_log.level_event then
1448: fnd_log.string(fnd_log.level_event,lower(p_product||'.plsql.'
1449: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1450: end if;
1451: if hr_utility.g_trace_on THEN
1444: ,p_message IN VARCHAR2 default null ) IS
1445: PROCEDURE set_location_trace IS
1446: BEGIN
1447: if fnd_log.g_current_runtime_level<=fnd_log.level_event then
1448: fnd_log.string(fnd_log.level_event,lower(p_product||'.plsql.'
1449: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1450: end if;
1451: if hr_utility.g_trace_on THEN
1452: hr_utility.g_error_stage := p_label;
1455: end if;
1456: END set_location_trace;
1457: BEGIN
1458: -- Check for Logging
1459: if fnd_log.g_current_runtime_level>fnd_log.level_event
1460: and NOT hr_utility.g_trace_on then
1461: RETURN;
1462: else
1463: set_location_trace;
1517: ,p_label IN VARCHAR2
1518: ,p_message IN VARCHAR2 default null ) IS
1519: PROCEDURE set_location_trace IS
1520: BEGIN
1521: if fnd_log.g_current_runtime_level<=fnd_log.level_exception then
1522: fnd_log.string(fnd_log.level_exception,lower(p_product||'.plsql.'
1523: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1524: end if;
1525: if hr_utility.g_trace_on THEN
1518: ,p_message IN VARCHAR2 default null ) IS
1519: PROCEDURE set_location_trace IS
1520: BEGIN
1521: if fnd_log.g_current_runtime_level<=fnd_log.level_exception then
1522: fnd_log.string(fnd_log.level_exception,lower(p_product||'.plsql.'
1523: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1524: end if;
1525: if hr_utility.g_trace_on THEN
1526: hr_utility.g_error_stage := p_label;
1529: end if;
1530: END set_location_trace;
1531: BEGIN
1532: -- Check for Logging
1533: if fnd_log.g_current_runtime_level>fnd_log.level_exception
1534: and NOT hr_utility.g_trace_on then
1535: RETURN;
1536: else
1537: set_location_trace;
1589: ,p_label IN VARCHAR2
1590: ,p_message IN VARCHAR2 default null ) IS
1591: PROCEDURE set_location_trace IS
1592: BEGIN
1593: if fnd_log.g_current_runtime_level<=fnd_log.level_error then
1594: fnd_log.string(fnd_log.level_error,lower(p_product||'.plsql.'
1595: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1596: end if;
1597: if hr_utility.g_trace_on THEN
1590: ,p_message IN VARCHAR2 default null ) IS
1591: PROCEDURE set_location_trace IS
1592: BEGIN
1593: if fnd_log.g_current_runtime_level<=fnd_log.level_error then
1594: fnd_log.string(fnd_log.level_error,lower(p_product||'.plsql.'
1595: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1596: end if;
1597: if hr_utility.g_trace_on THEN
1598: hr_utility.g_error_stage := p_label;
1601: end if;
1602: END set_location_trace;
1603: BEGIN
1604: -- Check for Logging
1605: if fnd_log.g_current_runtime_level>fnd_log.level_error
1606: and NOT hr_utility.g_trace_on then
1607: RETURN;
1608: else
1609: set_location_trace;
1666: ,p_label IN VARCHAR2
1667: ,p_message IN VARCHAR2 default null ) IS
1668: PROCEDURE set_location_trace IS
1669: BEGIN
1670: if fnd_log.g_current_runtime_level<=fnd_log.level_unexpected then
1671: fnd_log.string(fnd_log.level_unexpected,lower(p_product||'.plsql.'
1672: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1673: end if;
1674: if hr_utility.g_trace_on THEN
1667: ,p_message IN VARCHAR2 default null ) IS
1668: PROCEDURE set_location_trace IS
1669: BEGIN
1670: if fnd_log.g_current_runtime_level<=fnd_log.level_unexpected then
1671: fnd_log.string(fnd_log.level_unexpected,lower(p_product||'.plsql.'
1672: ||p_procedure_name)||'.'||p_label,nvl(p_message,p_label));
1673: end if;
1674: if hr_utility.g_trace_on THEN
1675: hr_utility.g_error_stage := p_label;
1678: end if;
1679: END set_location_trace;
1680: BEGIN
1681: -- Check for Logging
1682: if fnd_log.g_current_runtime_level>fnd_log.level_unexpected
1683: and NOT hr_utility.g_trace_on then
1684: RETURN;
1685: else
1686: set_location_trace;
1704: responsibility_id.
1705:
1706: PARAMETERS
1707:
1708: p_logging_level: possible values: FND_LOG.LEVEL_UNEXPECTED
1709: FND_LOG.LEVEL_ERROR
1710: FND_LOG.LEVEL_EXCEPTION
1711: FND_LOG.LEVEL_EVENT
1712: FND_LOG.LEVEL_PROCEDURE
1705:
1706: PARAMETERS
1707:
1708: p_logging_level: possible values: FND_LOG.LEVEL_UNEXPECTED
1709: FND_LOG.LEVEL_ERROR
1710: FND_LOG.LEVEL_EXCEPTION
1711: FND_LOG.LEVEL_EVENT
1712: FND_LOG.LEVEL_PROCEDURE
1713: FND_LOG.LEVEL_STATEMENT
1706: PARAMETERS
1707:
1708: p_logging_level: possible values: FND_LOG.LEVEL_UNEXPECTED
1709: FND_LOG.LEVEL_ERROR
1710: FND_LOG.LEVEL_EXCEPTION
1711: FND_LOG.LEVEL_EVENT
1712: FND_LOG.LEVEL_PROCEDURE
1713: FND_LOG.LEVEL_STATEMENT
1714: default is FND_LOG.LEVEL_STATEMENT
1707:
1708: p_logging_level: possible values: FND_LOG.LEVEL_UNEXPECTED
1709: FND_LOG.LEVEL_ERROR
1710: FND_LOG.LEVEL_EXCEPTION
1711: FND_LOG.LEVEL_EVENT
1712: FND_LOG.LEVEL_PROCEDURE
1713: FND_LOG.LEVEL_STATEMENT
1714: default is FND_LOG.LEVEL_STATEMENT
1715: p_user_id: user id for which logging will be enabled
1708: p_logging_level: possible values: FND_LOG.LEVEL_UNEXPECTED
1709: FND_LOG.LEVEL_ERROR
1710: FND_LOG.LEVEL_EXCEPTION
1711: FND_LOG.LEVEL_EVENT
1712: FND_LOG.LEVEL_PROCEDURE
1713: FND_LOG.LEVEL_STATEMENT
1714: default is FND_LOG.LEVEL_STATEMENT
1715: p_user_id: user id for which logging will be enabled
1716: p_responsibility_id: responsibility id for which logging will
1709: FND_LOG.LEVEL_ERROR
1710: FND_LOG.LEVEL_EXCEPTION
1711: FND_LOG.LEVEL_EVENT
1712: FND_LOG.LEVEL_PROCEDURE
1713: FND_LOG.LEVEL_STATEMENT
1714: default is FND_LOG.LEVEL_STATEMENT
1715: p_user_id: user id for which logging will be enabled
1716: p_responsibility_id: responsibility id for which logging will
1717: be enabled
1710: FND_LOG.LEVEL_EXCEPTION
1711: FND_LOG.LEVEL_EVENT
1712: FND_LOG.LEVEL_PROCEDURE
1713: FND_LOG.LEVEL_STATEMENT
1714: default is FND_LOG.LEVEL_STATEMENT
1715: p_user_id: user id for which logging will be enabled
1716: p_responsibility_id: responsibility id for which logging will
1717: be enabled
1718: */
1717: be enabled
1718: */
1719:
1720: procedure switch_logging_on
1721: (p_logging_level in number default fnd_log.level_statement
1722: ,p_user_id in number default null
1723: ,p_responsibility_id in number default null) is
1724: --
1725: -- we'll be updating user profile values so use an autonomous transaction
1929: Please see package specification for a description and usage examples.
1930: */
1931: function debug_enabled return boolean is
1932: begin
1933: return( fnd_log.g_current_runtime_level <= fnd_log.level_procedure
1934: or hr_utility.g_trace_on ) ;
1935: end debug_enabled;
1936:
1937: /*Function added to get the ICX Attribute value*/