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
09c1baab
Commit
09c1baab
authored
Jan 20, 2007
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code that places LOG error level between ERROR and PANIC into new
function is_log_level_output(), for code clarity.
parent
92b8d17a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
26 deletions
+29
-26
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+29
-26
No files found.
src/backend/utils/error/elog.c
View file @
09c1baab
...
...
@@ -42,7 +42,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.1
79 2007/01/05 22:19:43
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.1
80 2007/01/20 14:45:35
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -121,6 +121,7 @@ static char *expand_fmt_string(const char *fmt, ErrorData *edata);
static
const
char
*
useful_strerror
(
int
errnum
);
static
const
char
*
error_severity
(
int
elevel
);
static
void
append_with_tabs
(
StringInfo
buf
,
const
char
*
str
);
static
int
is_log_level_output
(
int
elevel
,
int
log_min_level
);
/*
...
...
@@ -139,7 +140,7 @@ errstart(int elevel, const char *filename, int lineno,
const
char
*
funcname
)
{
ErrorData
*
edata
;
bool
output_to_server
=
false
;
bool
output_to_server
;
bool
output_to_client
=
false
;
int
i
;
...
...
@@ -196,33 +197,10 @@ errstart(int elevel, const char *filename, int lineno,
/* Determine whether message is enabled for server log output */
if
(
IsPostmasterEnvironment
)
{
/* Complicated because LOG is sorted out-of-order for this purpose */
if
(
elevel
==
LOG
||
elevel
==
COMMERROR
)
{
if
(
log_min_messages
==
LOG
)
output_to_server
=
true
;
else
if
(
log_min_messages
<
FATAL
)
output_to_server
=
true
;
}
else
{
/* elevel != LOG */
if
(
log_min_messages
==
LOG
)
{
if
(
elevel
>=
FATAL
)
output_to_server
=
true
;
}
/* Neither is LOG */
else
if
(
elevel
>=
log_min_messages
)
output_to_server
=
true
;
}
}
output_to_server
=
is_log_level_output
(
elevel
,
log_min_messages
);
else
{
/* In bootstrap/standalone case, do not sort LOG out-of-order */
output_to_server
=
(
elevel
>=
log_min_messages
);
}
/* Determine whether message is enabled for client output */
if
(
whereToSendOutput
==
DestRemote
&&
elevel
!=
COMMERROR
)
...
...
@@ -2073,3 +2051,28 @@ write_stderr(const char *fmt,...)
#endif
va_end
(
ap
);
}
static
int
is_log_level_output
(
int
elevel
,
int
log_min_level
)
{
/*
* Complicated because LOG is sorted out-of-order here, between
* ERROR and FATAL.
*/
if
(
elevel
==
LOG
||
elevel
==
COMMERROR
)
{
if
(
log_min_level
==
LOG
||
log_min_level
<=
ERROR
)
return
true
;
}
else
if
(
log_min_level
==
LOG
)
{
/* elevel != LOG */
if
(
elevel
>=
FATAL
)
return
true
;
}
/* Neither is LOG */
else
if
(
elevel
>=
log_min_level
)
return
true
;
return
false
;
}
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