Changeset 223c9d5 in flexoentity


Ignore:
Timestamp:
11/05/25 07:23:42 (2 months ago)
Author:
Enrico Schwass <ennoausberlin@…>
Branches:
master
Children:
269fdc2
Parents:
73d392f
Message:

let others import my logger

Location:
flexoentity
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • flexoentity/__init__.py

    r73d392f r223c9d5  
    99# configuration created this dir with the appropriate rights
    1010
    11 import logging
    12 import logging.config
    13 import os
    14 from pathlib import Path
    1511from importlib.metadata import version, PackageNotFoundError
    16 
    17 log_dir = Path(os.environ.get('FLEXO_LOG_DIR', '/tmp/'))
    18 
    19 log_path = log_dir / 'flexo.log'
    20 
    21 if not log_path.exists():
    22     try:
    23         log_path.touch()
    24     except PermissionError:
    25         conf_file = Path(__file__).parent / 'flexo_logging.conf'
    26         print("Conf file", conf_file)
    27         logging.config.fileConfig(conf_file)
    28 else:
    29     logging.basicConfig(filename=str(log_path), encoding='utf-8', level=logging.DEBUG)
    30 
    31 logger = logging.getLogger(__name__)
    32 
    33 logger.setLevel(os.environ.get('FLEXO_LOG_LEVEL', logger.getEffectiveLevel()))
    34 
     12from .logger import logger
    3513from .id_factory import FlexOID, canonical_seed
    3614from .flexo_entity import FlexoEntity, EntityType, EntityState
     
    4422    "Domain",
    4523    "EntityState",
     24    "logger"
    4625]
    4726
Note: See TracChangeset for help on using the changeset viewer.