Mahdi Azmandian

22 papers A* 4B 4Misc 1Journal 3Unranked 9
YearRankTypeTitle / Venue / Authors
2024 conf
VR Workshops
Raiffa Syamil, Mahdi Azmandian, Sergio Casas, Pedro Morillo, Carolina Cruz-Neira
2022 J jnl
IEEE Trans. Vis. Comput. Graph.
Mahdi Azmandian, Rhys Yahata, Timofey Grechkin, Evan Suma Rosenberg
2022 J jnl
IEEE Trans. Vis. Comput. Graph.
Mahdi Azmandian, Rhys Yahata, Timofey Grechkin, Jerald Thomas, Evan Suma Rosenberg
2020 J jnl
IEEE Trans. Vis. Comput. Graph.
Qi Sun, Mahdi Azmandian, James Baumeister
2019 B conf
IVA
Jorge Arroyo-Palacios, Mahdi Azmandian, Steven Osman
2019 ch.
VR Developer Gems
Mahdi Azmandian, Rhys Yahata
2019 B conf
IVA
Mahdi Azmandian, Jorge Arroyo-Palacios, Steven Osman
2017 A* conf
VR
Mahdi Azmandian, Timofey Grechkin, Evan Suma Rosenberg
2017 conf
ICAT-EGVE
Jerald Thomas, Mahdi Azmandian, Sonia Grunwald, Donna Le, David M. Krum, Sin-Hwa Kang, Evan Suma Rosenberg
2016 conf
CHI Extended Abstracts
Mahdi Azmandian, Mark Hancock, Hrvoje Benko, Eyal Ofek, Andrew D. Wilson
2016 Misc conf
ISS
Mahdi Azmandian, Mark Hancock, Hrvoje Benko, Eyal Ofek, Andrew D. Wilson
2016 conf
3DUI
Mahdi Azmandian, Timofey Grechkin, Mark T. Bolas, Evan A. Suma
2016 conf
CHI Extended Abstracts
Mahdi Azmandian, Mark Hancock, Hrvoje Benko, Eyal Ofek, Andrew D. Wilson
2016 A* conf
CHI
Mahdi Azmandian, Mark Hancock, Hrvoje Benko, Eyal Ofek, Andrew D. Wilson
2016 B conf
SAP
Timofey Grechkin, Jerald Thomas, Mahdi Azmandian, Mark T. Bolas, Evan A. Suma
2016 conf
WEVR@VR
Mahdi Azmandian, Timofey Grechkin, Mark T. Bolas, Evan A. Suma
2015 conf
SIGGRAPH Emerging Technologies
Evan A. Suma, Mahdi Azmandian, Timofey Grechkin, Thai Phan, Mark T. Bolas
2015 conf
ICAT-EGVE
Mahdi Azmandian, Timofey Grechkin, Mark T. Bolas, Evan A. Suma
2015 A* conf
VR
Timofey Grechkin, Mahdi Azmandian, Mark T. Bolas, Evan A. Suma
2014 A* conf
VR
Mahdi Azmandian, Rhys Yahata, Mark T. Bolas, Evan A. Suma
2014 B conf
SAP
Mahdi Azmandian, Mark T. Bolas, Evan A. Suma
2012 conf
ADMI
Mahdi Azmandian, Karan Singh, Ben Gelsey, Yu-Han Chang, Rajiv T. Maheswaran
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