Neil Dalchau

16 papers A* 2B 2Journal 11Unranked 1
YearRankTypeTitle / Venue / Authors
2025 J jnl
CoRR
James King, Lewis Cornwall, Andrei Cristian Nica, James Day, Aaron Sim, Neil Dalchau, Lilly Wollman, Joshua Meyers
2022 J jnl
CoRR
Jakub Fil, Neil Dalchau, Dominique F. Chu
2021 A* conf
NeurIPS
Gregory Szép, Neil Dalchau, Attila Csikász-Nagy
2021 J jnl
CoRR
Gregory Szép, Neil Dalchau, Attila Csikász-Nagy
2019 A* conf
ICML
Geoffrey Roeder, Paul K. Grant, Andrew Phillips, Neil Dalchau, Edward Meeds
2019 J jnl
CoRR
Geoffrey Roeder, Paul K. Grant, Andrew Phillips, Neil Dalchau, Edward Meeds
2019 conf
CMSB
Carlo Spaccasassi, Boyan Yordanov, Andrew Phillips, Neil Dalchau
2018 J jnl
Nat. Comput.
Neil Dalchau, Gregory Szép, Rosa D. Hernansaiz-Ballesteros, Chris P. Barnes, Luca Cardelli, Andrew Phillips, Attila Csikász-Nagy
2018 J jnl
Dagstuhl Reports
Yaakov Benenson, Neil Dalchau, Heinz Koeppl, Oded Maler
2018 J jnl
Nat. Comput.
Yiyu Xiang, Neil Dalchau, Baojun Wang
2017 J jnl
PLoS Comput. Biol.
Luca Cardelli, Rosa D. Hernansaiz-Ballesteros, Neil Dalchau, Attila Csikász-Nagy
2015 B conf
DNA
Neil Dalchau, Niall Murphy, Rasmus L. Petersen, Boyan Yordanov
2015 J jnl
CoRR
Neil Dalchau, Niall Murphy, Rasmus L. Petersen, Boyan Yordanov
2014 B conf
DNA
Neil Dalchau, Georg Seelig, Andrew Phillips
2014 J jnl
PLoS Comput. Biol.
James M. Osborne, Miguel O. Bernabeu, Maria Bruna, Ben Calderhead, Jonathan Cooper, Neil Dalchau, Sara-Jane Dunn, Alexander G. Fletcher, Robin Freeman, Derek Groen, Bernhard Knapp, Greg J. McInerny, Gary R. Mirams, Joe Pitt-Francis, Biswa Sengupta, David W. Wright, Christian A. Yates, David Gavaghan, Stephen Emmott, Charlotte M. Deane
2011 J jnl
PLoS Comput. Biol.
Neil Dalchau, James Andrew Phillips, Leonard D. Goldstein, Mark Howarth, Luca Cardelli, Stephen Emmott, Tim Elliott, Joern M. Werner
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