drop unused add_db_logger call and db table

Fixes: https://pagure.io/koji/issue/469
This commit is contained in:
Tomas Kopecek 2017-07-06 13:36:38 +02:00 committed by Mike McLean
parent 3fd55d1454
commit d17157cf33
4 changed files with 9 additions and 23 deletions

View file

@ -17,7 +17,6 @@ DROP TABLE IF EXISTS archivetypes;
DROP TABLE IF EXISTS win_builds;
DROP TABLE IF EXISTS maven_builds;
DROP TABLE IF EXISTS build_notifications;
DROP TABLE IF EXISTS log_messages;
DROP TABLE IF EXISTS buildroot_listing;
DROP TABLE IF EXISTS rpmsigs;
DROP TABLE IF EXISTS rpminfo;

View file

@ -0,0 +1,9 @@
-- upgrade script to migrate the Koji database schema
-- from version 1.13 to 1.14
BEGIN;
-- drop unused log_messages table
DROP TABLE log_messages;
COMMIT;

View file

@ -685,16 +685,6 @@ CREATE TABLE buildroot_listing (
) WITHOUT OIDS;
CREATE INDEX buildroot_listing_rpms ON buildroot_listing(rpm_id);
CREATE TABLE log_messages (
id SERIAL NOT NULL PRIMARY KEY,
message TEXT NOT NULL,
message_time TIMESTAMP NOT NULL DEFAULT NOW(),
logger_name VARCHAR(200) NOT NULL,
level VARCHAR(10) NOT NULL,
location VARCHAR(200),
host VARCHAR(200)
) WITHOUT OIDS;
CREATE TABLE build_notifications (
id SERIAL NOT NULL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users (id),

View file

@ -3025,17 +3025,5 @@ def add_mail_logger(logger, addr):
handler.setLevel(logging.ERROR)
logging.getLogger(logger).addHandler(handler)
def add_db_logger(logger, cnx):
handler = DBHandler(cnx, "log_messages", {'message': '%(message)s',
'message_time': '%(asctime)s',
'logger_name': '%(name)s',
'level': '%(levelname)s',
'location': '%(pathname)s:%(lineno)d',
'host': socket.getfqdn(),
})
handler.setFormatter(logging.Formatter(datefmt='%Y-%m-%d %H:%M:%S'))
logging.getLogger(logger).addHandler(handler)
return handler
def remove_log_handler(logger, handler):
logging.getLogger(logger).removeHandler(handler)