pglogger

functions/GET_LOGGING_LEVEL.pg_sql

Functions

GET_LOGGING_LEVEL
Returns the logging level as defined in the property table.
Private
Just used internally.
Syntax:
GET_LOGGING_LEVEL ()
Return values:
  • TEXT Value: of the property LOGGING_LEVEL
Copyright:
Thiemo Kellner, 2018 -
Webpage:
https://www.sourceforge.net/projects/pglogger
Version Info:
$Id: GET_LOGGING_LEVEL.pg_sql 16 2018-06-15 20:23:26Z thiemo $
Additional Info:
  • This function is meant to be private. Its use outside pglogger is very limited at most. That's why it is marked as private eventhough it is visible to the outside. All of this is due to the fact that PostgreSQL 10 and earlier does not support packages.
  • License LGPLv3
TODO:
  • Once PostgreSQL supports packages, integrate this function into one. For the time being, it should get installed within a schema on its own and no execution grants should be given on it.
  • Once HyperSQL supports a license tag, convert the corresponding info tag into one.

Source

001: \echo Start functions/GET_LOGGING_LEVEL.pg_sql
002: 
003: /** Returns the logging level as defined in the property table.
004:  *
005:  *  @function GET_LOGGING_LEVEL
006:  *  @return text Value of the property LOGGING_LEVEL
007:  *  @private
008:  *  @info This function is meant to be private. Its use outside pglogger is
009:  *        very limited at most. That's why it is marked as private eventhough
010:  *        it is visible to the outside. All of this is due to the fact that
011:  *        PostgreSQL 10 and earlier does not support packages.
012:  *  @version $Id: GET_LOGGING_LEVEL.pg_sql 16 2018-06-15 20:23:26Z thiemo $
013:  *  @todo Once PostgreSQL supports packages, integrate this function into one.
014:  *        For the time being, it should get installed within a schema on its
015:  *        own and no execution grants should be given on it.
016:  *  @todo Once HyperSQL supports a license tag, convert the corresponding
017:  *        info tag into one.
018:  *  @copyright Thiemo Kellner, 2018 -
019:  *  @info License LGPLv3
020:  *  @webpage https://www.sourceforge.net/projects/pglogger
021:  */
022: create or replace function GET_LOGGING_LEVEL()
023:   returns text
024:   language plpgsql
025:   stable
026:   -- Include the hosting schema into search_path so that dblink
027:   -- can find the pglogger objects. There is no need to access
028:   -- objects in other schematas not covered with public.
029:   set search_path = :SCHEMA_NAME, public
030:   as
031: $body$
032:     declare
033:         V_OVERRIDE_LEVEL text;
034:         V_PROPERTY_LEVEL text;
035:     begin
036:         select LEVEL into V_OVERRIDE_LEVEL
037:           from LEVEL
038:          where SCOPE = GET_CALLER_FUNCTION();
039:         if V_OVERRIDE_LEVEL is null then
040:             return GET_PROPERTY_VALUE_STRING('LOGGING_LEVEL');
041:         else
042:             return V_OVERRIDE_LEVEL;
043:         end if;
044:     end;
045: $body$;
046: 
047: comment on function GET_LOGGING_LEVEL() is 'Returns the logging level as defined in the property table.
048: $Header: svn+ssh://thiemo@svn.code.sf.net/p/pglogger/code/functions/GET_LOGGING_LEVEL.pg_sql 16 2018-06-15 20:23:26Z thiemo $';
049: 
050: commit; -- unlike Oracle not all ddl commit implicitly
051: 
052: \echo End functions/GET_LOGGING_LEVEL.pg_sql


pglogger
Generated by HyperSQL v3.9.8 at Wed Jul 4 07:48:46 2018