aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-09-16 21:20:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-09-16 21:20:20 +0000
commit914e177a3e3e99fef6439f07c204d156e1bd1fc1 (patch)
tree86f799b03d4f3807318e20708eecd55058e99902
parent1cfd2012a6cab78fd5e4cf126f956578c0f4e1ed (diff)
downloadpostgresql-914e177a3e3e99fef6439f07c204d156e1bd1fc1.tar.gz
postgresql-914e177a3e3e99fef6439f07c204d156e1bd1fc1.zip
Remove contrib/pg_logger, per recent discussion.
-rw-r--r--contrib/Makefile3
-rw-r--r--contrib/README4
-rw-r--r--contrib/pg_logger/Makefile16
-rw-r--r--contrib/pg_logger/README.pg_logger1
-rw-r--r--contrib/pg_logger/pg_logger.c106
5 files changed, 1 insertions, 129 deletions
diff --git a/contrib/Makefile b/contrib/Makefile
index 1a25bfd17e6..321c1126f8e 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/contrib/Makefile,v 1.50 2004/08/28 21:36:24 tgl Exp $
+# $PostgreSQL: pgsql/contrib/Makefile,v 1.51 2004/09/16 21:20:19 tgl Exp $
subdir = contrib
top_builddir = ..
@@ -26,7 +26,6 @@ WANTED_DIRS = \
oid2name \
pg_autovacuum \
pg_dumplo \
- pg_logger \
pg_trgm \
pgbench \
pgcrypto \
diff --git a/contrib/README b/contrib/README
index 7cacdc2bde7..1cf43b6f661 100644
--- a/contrib/README
+++ b/contrib/README
@@ -140,10 +140,6 @@ pg_dumplo -
Dump large objects
by Karel Zak <zakkr@zf.jcu.cz>
-pg_logger -
- Stdin-to-syslog gateway for PostgreSQL
- by Nathan Myers <ncm@nospam.cantrip.org>
-
pg_trgm -
Functions for determining the similarity of text based on trigram
matching.
diff --git a/contrib/pg_logger/Makefile b/contrib/pg_logger/Makefile
deleted file mode 100644
index c3d99bf7467..00000000000
--- a/contrib/pg_logger/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $PostgreSQL: pgsql/contrib/pg_logger/Makefile,v 1.4 2004/08/20 20:13:06 momjian Exp $
-
-PROGRAM = pg_logger
-OBJS = pg_logger.o
-
-DOCS = README.pg_logger
-
-ifdef USE_PGXS
-PGXS = $(shell pg_config --pgxs)
-include $(PGXS)
-else
-subdir = contrib/pg_logger
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-include $(top_srcdir)/contrib/contrib-global.mk
-endif
diff --git a/contrib/pg_logger/README.pg_logger b/contrib/pg_logger/README.pg_logger
deleted file mode 100644
index aaad73f508e..00000000000
--- a/contrib/pg_logger/README.pg_logger
+++ /dev/null
@@ -1 +0,0 @@
-Stdin-to-syslog gateway for PostgreSQL
diff --git a/contrib/pg_logger/pg_logger.c b/contrib/pg_logger/pg_logger.c
deleted file mode 100644
index cb28bf5e7a2..00000000000
--- a/contrib/pg_logger/pg_logger.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* pg_logger: stdin-to-syslog gateway for postgresql.
- *
- * Copyright 2001 by Nathan Myers <ncm@nospam.cantrip.org>
- * This software is distributed free of charge with no warranty of any kind.
- * You have permission to make copies for any purpose, provided that (1)
- * this copyright notice is retained unchanged, and (2) you agree to
- * absolve the author of all responsibility for all consequences arising
- * from any use.
- */
-
-#include <stdio.h>
-#include <stddef.h>
-#include <syslog.h>
-#include <string.h>
-
-struct
-{
- const char *tag;
- int size;
- int priority;
-} tags[] =
-
-{
- {
- "", 0, LOG_NOTICE
- },
- {
- "emerg:", sizeof("emerg"), LOG_EMERG
- },
- {
- "alert:", sizeof("alert"), LOG_ALERT
- },
- {
- "crit:", sizeof("crit"), LOG_CRIT
- },
- {
- "err:", sizeof("err"), LOG_ERR
- },
- {
- "error:", sizeof("error"), LOG_ERR
- },
- {
- "warning:", sizeof("warning"), LOG_WARNING
- },
- {
- "notice:", sizeof("notice"), LOG_NOTICE
- },
- {
- "info:", sizeof("info"), LOG_INFO
- },
- {
- "debug:", sizeof("debug"), LOG_DEBUG
- }
-};
-
-int
-main()
-{
- char buf[301];
- int c;
- char *pos = buf;
- const char *colon = 0;
-
-#ifndef DEBUG
- openlog("postgresql", LOG_CONS, LOG_LOCAL1);
-#endif
- while ((c = getchar()) != EOF)
- {
- if (c == '\r')
- continue;
- if (c == '\n')
- {
- int level = sizeof(tags) / sizeof(*tags);
- char *bol;
-
- if (colon == 0 || (size_t) (colon - buf) > sizeof("warning"))
- level = 1;
- *pos = 0;
- while (--level)
- {
- if (pos - buf >= tags[level].size
- && strncmp(buf, tags[level].tag, tags[level].size) == 0)
- break;
- }
- bol = buf + tags[level].size;
- if (bol > buf && *bol == ' ')
- ++bol;
- if (pos - bol > 0)
- {
-#ifndef DEBUG
- syslog(tags[level].priority, "%s", bol);
-#else
- printf("%d/%s\n", tags[level].priority, bol);
-#endif
- }
- pos = buf;
- colon = (char const *) 0;
- continue;
- }
- if (c == ':' && !colon)
- colon = pos;
- if ((size_t) (pos - buf) < sizeof(buf) - 1)
- *pos++ = c;
- }
- return 0;
-}