Skip to content

Commit

Permalink
Lazily import logging
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicWink committed Oct 4, 2024
1 parent 09509aa commit 004765c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pyfqmr/Simplify.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ cimport cython
from libcpp.vector cimport vector
from libcpp cimport bool

from logging import getLogger
from time import time as _time

cimport numpy as np
import numpy as np

logger = getLogger("pyfqmr")

class _hidden_ref(object):
"""Hidden Python object to keep a reference to our numpy arrays
"""
Expand All @@ -33,7 +30,9 @@ cdef extern from "Simplify.h" namespace "Simplify" :

cdef void log_message(char* message, int length) noexcept:
if message is not NULL:
logger.debug(message.decode("utf-8"))
from logging import getLogger

getLogger("pyfqmr").debug(message.decode("utf-8"))

cdef class Simplify :

Expand Down

0 comments on commit 004765c

Please sign in to comment.