Rachael Rafter

22 papers A* 1A 6B 1C 1Misc 1Journal 3Unranked 9
YearRankTypeTitle / Venue / Authors
2016 A conf
UMAP
Barry Smyth, Rachael Rafter, Sam Banks
2015 B conf
HCOMP
Barry Smyth, Rachael Rafter, Sam Banks
2015 conf
UMAP Workshops
Khalil Muhammad, Aonghus Lawlor, Rachael Rafter, Barry Smyth
2015 C conf
ICCBR
Khalil Muhammad, Aonghus Lawlor, Rachael Rafter, Barry Smyth
2015 A conf
UMAP
Doychin Doychev, Rachael Rafter, Aonghus Lawlor, Barry Smyth
2015 conf
SGAI Conf.
Aonghus Lawlor, Khalil Muhammad, Rachael Rafter, Barry Smyth
2015 A conf
RecSys
Sam Banks, Rachael Rafter, Barry Smyth
2014 J jnl
Comput. Sci. Inf. Syst.
Athanasios Staikopoulos, Ian O'Keeffe, Rachael Rafter, Eddie Walsh, Bilal Yousuf, Owen Conlan, Vincent Wade
2014 conf
CLEF (Working Notes)
Doychin Doychev, Aonghus Lawlor, Rachael Rafter
2013 conf
IUI Companion
Steven Bourke, Michael P. O'Mahony, Rachael Rafter, Barry Smyth
2013 A conf
UMAP
Zurina Saaya, Markus Schaal, Rachael Rafter, Barry Smyth
2013 A conf
RecSys
Zurina Saaya, Rachael Rafter, Markus Schaal, Barry Smyth
2012 conf
ICWL
Athanasios Staikopoulos, Ian O'Keeffe, Rachael Rafter, Eddie Walsh, Bilal Yousuf, Owen Conlan, Vincent Wade
2012 conf
SGAI Conf.
Steven Bourke, Michael P. O'Mahony, Rachael Rafter, Kevin McCarthy, Barry Smyth
2012 conf
I-KNOW
Ian O'Keeffe, Athanasios Staikopoulos, Rachael Rafter, Eddie Walsh, Bilal Yousuf, Owen Conlan, Vincent Wade
2011 Misc conf
IRI
Eddie Walsh, Rachael Rafter, Owen Conlan, Vincent Wade
2009 A conf
UMAP
Rachael Rafter, Michael P. O'Mahony, Neil J. Hurley, Barry Smyth
2005 J jnl
Artif. Intell. Rev.
Rachael Rafter, Barry Smyth
2003 A* conf
IJCAI
Rachael Rafter, Barry Smyth
2002 J jnl
Commun. ACM
Barry Smyth, Keith Bradley, Rachael Rafter
2000 conf
AH
Rachael Rafter, Keith Bradley, Barry Smyth
2000 conf
AH
Keith Bradley, Rachael Rafter, Barry Smyth
redb/logging_utils.py
← Index redb/logging_utils.py python
"""
Logging utilities and shared enums for REDB.

Contains the ImportResult enum, log formatters, and logger setup functions
used across the ingestor pipeline.
"""
import logging
from logging.handlers import QueueHandler
import os
from enum import Enum


class ImportResult(Enum):
    CORRECTLY = 0
    PARTIALLY = 1
    FAILED = 2
    PENDING = 3
    SKIPPED = 4


class FileNameFormatter(logging.Formatter):
    def format(self, record):
        record.filenameinfo = getattr(record, "filenameinfo", "unknown")
        return super().format(record)


def setup_logger(log_queue, filename):
    logger = logging.getLogger(filename)
    if not logger.handlers:
        if os.getenv("SERVER_ENV") == "prod":
            logger.setLevel(logging.INFO)
        else:
            logger.setLevel(logging.DEBUG)
        handler = QueueHandler(log_queue)
        logger.addHandler(handler)
        logger.propagate = False  # Prevent propagation to parent loggers
    return logger


def logger_thread(log_queue, log_file):
    handler = logging.FileHandler(log_file)
    formatter = FileNameFormatter(
        "%(asctime)s - %(filenameinfo)s - %(levelname)s - %(message)s"
    )
    handler.setFormatter(formatter)

    while True:
        try:
            record = log_queue.get()
            if record is None:
                break
            # Format and write the log record
            message = formatter.format(record)
            handler.stream.write(message + "\n")
            handler.stream.flush()
        except Exception:
            import traceback
            import sys

            print("[ERR] Error in logger thread:", file=sys.stderr)
            traceback.print_exc(file=sys.stderr)


def setup_direct_logger(log_file, filename, pid=None):
    """Setup a logger that writes directly to the log file without using a queue."""
    # Create a unique logger name using the process ID
    logger_name = f"{filename}_{pid}" if pid else filename
    logger = logging.getLogger(logger_name)

    if not logger.handlers:
        handler = logging.FileHandler(log_file)
        formatter = logging.Formatter("%(asctime)s - %(filenameinfo)s - %(levelname)s - %(message)s")
        handler.setFormatter(formatter)
        logger.addHandler(handler)

        if os.getenv("SERVER_ENV") == "prod":
            logger.setLevel(logging.INFO)
        else:
            logger.setLevel(logging.DEBUG)

    # Add filename info to the logger's extra info
    extra = {"filenameinfo": filename}
    logger = logging.LoggerAdapter(logger, extra)

    return logger