Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
409e386b
Commit
409e386b
authored
Apr 03, 2008
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert syslog_facility guc to enum type.
parent
b011c5ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
41 deletions
+31
-41
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+31
-41
No files found.
src/backend/utils/misc/guc.c
View file @
409e386b
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.44
1 2008/04/02 14:42:56
mha Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.44
2 2008/04/03 09:21:15
mha Exp $
*
*
*--------------------------------------------------------------------
*--------------------------------------------------------------------
*/
*/
...
@@ -135,8 +135,8 @@ static const char *assign_log_destination(const char *value,
...
@@ -135,8 +135,8 @@ static const char *assign_log_destination(const char *value,
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
static
int
syslog_facility
=
LOG_LOCAL0
;
static
int
syslog_facility
=
LOG_LOCAL0
;
static
const
char
*
assign_syslog_facility
(
const
char
*
facility
,
static
bool
assign_syslog_facility
(
int
newval
,
bool
doit
,
GucSource
source
);
bool
doit
,
GucSource
source
);
static
const
char
*
assign_syslog_ident
(
const
char
*
ident
,
static
const
char
*
assign_syslog_ident
(
const
char
*
ident
,
bool
doit
,
GucSource
source
);
bool
doit
,
GucSource
source
);
#endif
#endif
...
@@ -229,6 +229,18 @@ static const struct config_enum_entry session_replication_role_options[] = {
...
@@ -229,6 +229,18 @@ static const struct config_enum_entry session_replication_role_options[] = {
{
NULL
,
0
}
{
NULL
,
0
}
};
};
static
const
struct
config_enum_entry
syslog_facility_options
[]
=
{
{
"local0"
,
LOG_LOCAL0
},
{
"local1"
,
LOG_LOCAL1
},
{
"local2"
,
LOG_LOCAL2
},
{
"local3"
,
LOG_LOCAL3
},
{
"local4"
,
LOG_LOCAL4
},
{
"local5"
,
LOG_LOCAL5
},
{
"local6"
,
LOG_LOCAL6
},
{
"local7"
,
LOG_LOCAL7
},
{
NULL
,
0
}
};
/*
/*
* GUC option variables that are exported from this module
* GUC option variables that are exported from this module
...
@@ -283,7 +295,6 @@ int tcp_keepalives_count;
...
@@ -283,7 +295,6 @@ int tcp_keepalives_count;
static
char
*
log_destination_string
;
static
char
*
log_destination_string
;
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
static
char
*
syslog_facility_str
;
static
char
*
syslog_ident_str
;
static
char
*
syslog_ident_str
;
#endif
#endif
static
bool
phony_autocommit
;
static
bool
phony_autocommit
;
...
@@ -2231,15 +2242,6 @@ static struct config_string ConfigureNamesString[] =
...
@@ -2231,15 +2242,6 @@ static struct config_string ConfigureNamesString[] =
},
},
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
{
{
"syslog_facility"
,
PGC_SIGHUP
,
LOGGING_WHERE
,
gettext_noop
(
"Sets the syslog
\"
facility
\"
to be used when syslog enabled."
),
gettext_noop
(
"Valid values are LOCAL0, LOCAL1, LOCAL2, LOCAL3, "
"LOCAL4, LOCAL5, LOCAL6, LOCAL7."
)
},
&
syslog_facility_str
,
"LOCAL0"
,
assign_syslog_facility
,
NULL
},
{
{
{
"syslog_ident"
,
PGC_SIGHUP
,
LOGGING_WHERE
,
{
"syslog_ident"
,
PGC_SIGHUP
,
LOGGING_WHERE
,
gettext_noop
(
"Sets the program name used to identify PostgreSQL "
gettext_noop
(
"Sets the program name used to identify PostgreSQL "
...
@@ -2488,6 +2490,18 @@ static struct config_enum ConfigureNamesEnum[] =
...
@@ -2488,6 +2490,18 @@ static struct config_enum ConfigureNamesEnum[] =
LOGSTMT_NONE
,
log_statement_options
,
NULL
,
NULL
LOGSTMT_NONE
,
log_statement_options
,
NULL
,
NULL
},
},
#ifdef HAVE_SYSLOG
{
{
"syslog_facility"
,
PGC_SIGHUP
,
LOGGING_WHERE
,
gettext_noop
(
"Sets the syslog
\"
facility
\"
to be used when syslog enabled."
),
gettext_noop
(
"Valid values are LOCAL0, LOCAL1, LOCAL2, LOCAL3, "
"LOCAL4, LOCAL5, LOCAL6, LOCAL7."
)
},
&
syslog_facility
,
LOG_LOCAL0
,
syslog_facility_options
,
assign_syslog_facility
,
NULL
},
#endif
{
{
{
"regex_flavor"
,
PGC_USERSET
,
COMPAT_OPTIONS_PREVIOUS
,
{
"regex_flavor"
,
PGC_USERSET
,
COMPAT_OPTIONS_PREVIOUS
,
gettext_noop
(
"Sets the regular expression
\"
flavor
\"
."
),
gettext_noop
(
"Sets the regular expression
\"
flavor
\"
."
),
...
@@ -6860,38 +6874,14 @@ assign_log_destination(const char *value, bool doit, GucSource source)
...
@@ -6860,38 +6874,14 @@ assign_log_destination(const char *value, bool doit, GucSource source)
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
static
const
char
*
static
bool
assign_syslog_facility
(
const
char
*
facility
,
bool
doit
,
GucSource
source
)
assign_syslog_facility
(
int
newval
,
bool
doit
,
GucSource
source
)
{
{
int
syslog_fac
;
if
(
pg_strcasecmp
(
facility
,
"LOCAL0"
)
==
0
)
syslog_fac
=
LOG_LOCAL0
;
else
if
(
pg_strcasecmp
(
facility
,
"LOCAL1"
)
==
0
)
syslog_fac
=
LOG_LOCAL1
;
else
if
(
pg_strcasecmp
(
facility
,
"LOCAL2"
)
==
0
)
syslog_fac
=
LOG_LOCAL2
;
else
if
(
pg_strcasecmp
(
facility
,
"LOCAL3"
)
==
0
)
syslog_fac
=
LOG_LOCAL3
;
else
if
(
pg_strcasecmp
(
facility
,
"LOCAL4"
)
==
0
)
syslog_fac
=
LOG_LOCAL4
;
else
if
(
pg_strcasecmp
(
facility
,
"LOCAL5"
)
==
0
)
syslog_fac
=
LOG_LOCAL5
;
else
if
(
pg_strcasecmp
(
facility
,
"LOCAL6"
)
==
0
)
syslog_fac
=
LOG_LOCAL6
;
else
if
(
pg_strcasecmp
(
facility
,
"LOCAL7"
)
==
0
)
syslog_fac
=
LOG_LOCAL7
;
else
return
NULL
;
/* reject */
if
(
doit
)
if
(
doit
)
{
syslog_facility
=
syslog_fac
;
set_syslog_parameters
(
syslog_ident_str
?
syslog_ident_str
:
"postgres"
,
set_syslog_parameters
(
syslog_ident_str
?
syslog_ident_str
:
"postgres"
,
syslog_facility
);
newval
);
}
return
facility
;
return
true
;
}
}
static
const
char
*
static
const
char
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment