Hadi Zare

39 papers A 1Journal 34Unranked 4
YearRankTypeTitle / Venue / Authors
2025 J jnl
CoRR
Ali Boudaghi, Hadi Zare
2024 J jnl
CoRR
Hossein Rafiee Zade, Hadi Zare, Mohsen Ghassemi Parsa, Hadi Davardoust, Meshkat Shariat Bagheri
2024 A conf
AISTATS
Soheila Molaei, Anshul Thakur, Ghazaleh Niknam, Andrew A. S. Soltan, Hadi Zare, David A. Clifton
2024 J jnl
Knowl. Based Syst.
Soheila Molaei, Ghazaleh Niknam, Ghadeer O. Ghosheh, Vinod Kumar Chauhan, Hadi Zare, Tingting Zhu, Shirui Pan, David A. Clifton
2024 J jnl
IEEE Internet Things J.
Rouhollah Ahmadian, Mehdi Ghatee, Johan Wahlström, Hadi Zare
2024 conf
ICDM (Workshops)
Zeinab Sadat Sadrolhefazi, Hadi Zare, Seyyed Amir Asghari, Parham Moradi, Mahdi Jalili
2023 J jnl
Appl. Netw. Sci.
Mohammad Ali Soltanshahi, Babak Teimourpour, Hadi Zare
2023 J jnl
Neural Networks
Ghazaleh Niknam, Soheila Molaei, Hadi Zare, Shirui Pan, Mahdi Jalili, Tingting Zhu, David A. Clifton
2023 J jnl
CoRR
Narges Sadat Fazeli Dehkordi, Hadi Zare, Parham Moradi, Mahdi Jalili
2023 J jnl
Neurocomputing
Ghazaleh Niknam, Soheila Molaei, Hadi Zare, David A. Clifton, Shirui Pan
2023 J jnl
IEEE Trans. Neural Networks Learn. Syst.
Soheila Molaei, Nima Ghanbari Bousejin, Hadi Zare, Mahdi Jalili, Shirui Pan
2022 J jnl
Expert Syst. Appl.
Mohammad Ali Soltanshahi, Babak Teimourpour, Toktam Khatibi, Hadi Zare
2022 J jnl
Expert Syst. Appl.
Mohsen Ghassemi Parsa, Hadi Zare, Mehdi Ghatee
2021 J jnl
Appl. Intell.
Sondos Bahadori, Parham Moradi, Hadi Zare
2021 J jnl
Digit. Signal Process.
Atieh Khodadadi, Soheila Molaei, Mehdi Teimouri, Hadi Zare
2021 J jnl
IEEE Access
Soheila Molaei, Amirhossein Havvaei, Hadi Zare, Mahdi Jalili
2021 J jnl
Neurocomputing
Soheila Molaei, Nima Ghanbari Bousejin, Hadi Zare, Mahdi Jalili
2021 J jnl
IEEE Trans. Knowl. Data Eng.
Hadi Zare, Mahdi Hajiabadi, Mahdi Jalili
2021 J jnl
CoRR
Mohsen Ghassemi Parsa, Hadi Zare, Mehdi Ghatee
2021 conf
PAKDD (3)
Bahareh Fatemi, Soheila Molaei, Hadi Zare, Shirui Pan
2021 J jnl
Expert Syst. Appl.
Sondos Bahadori, Hadi Zare, Parham Moradi
2020 J jnl
Knowl. Based Syst.
Soheila Molaei, Hadi Zare, Hadi Veisi
2020 J jnl
Expert Syst. Appl.
Kayvan Bijari, Hadi Zare, Emad Kebriaei, Hadi Veisi
2020 conf
IST
Sasan Hossein Alizadeh, Nima Shiri Harzevili, Alireza Hediehloo, Hadi Zare
2020 conf
IST
Hadi Zare, Mohsen Ghassemi Parsa, Mehdi Ghatee, Sasan Hossein Alizadeh
2020 J jnl
Eng. Appl. Artif. Intell.
Mohsen Ghassemi Parsa, Hadi Zare, Mehdi Ghatee
2019 J jnl
CoRR
Soheila Molaei, Hadi Zare, Hadi Veisi
2019 J jnl
CoRR
Kayvan Bijari, Hadi Zare, Hadi Veisi, Emad Kebriaei
2019 J jnl
CoRR
Hadi Zare, Mahdi Hajiabadi, Mahdi Jalili
2019 J jnl
Comput. Stat. Data Anal.
Shadi Abpeykar, Mehdi Ghatee, Hadi Zare
2019 J jnl
CoRR
Mohsen Ghassemi Parsa, Hadi Zare, Mehdi Ghatee
2018 J jnl
Neural Comput. Appl.
Kayvan Bijari, Hadi Zare, Hadi Veisi, Hossein Bobarshad
2017 J jnl
Knowl. Based Syst.
Mahdi Hajiabadi, Hadi Zare, Hossein Bobarshad
2017 J jnl
CoRR
Kayvan Bijari, Hadi Zare, Hadi Veisi, Hossein Bobarshad
2016 J jnl
Simul. Model. Pract. Theory
Mehdi Zarkeshzadeh, Hadi Zare, Zainabolhoda Heshmati, Mehdi Teimouri
2016 J jnl
CoRR
Mahdi Hajiabadi, Hadi Zare, Hossein Bobarshad
2016 J jnl
CoRR
Hadi Zare, Mojtaba Niazi
2016 J jnl
Eng. Appl. Artif. Intell.
Hadi Zare, Mojtaba Niazi
2013 J jnl
Intell. Data Anal.
Hadi Zare, Adel Mohammadpour, Parham Moradi
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