Skeleton ready
This commit is contained in:
0
shared/application/factory/__init__.py
Normal file
0
shared/application/factory/__init__.py
Normal file
10
shared/application/factory/application.py
Normal file
10
shared/application/factory/application.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import List
|
||||
|
||||
from kernel.feature.provider import Provider
|
||||
|
||||
from shared.application.rabbitmq_application import RabbitMQApplication
|
||||
from shared.application.rabbitmq_kernel import RabbitMQKernel
|
||||
|
||||
class Application:
|
||||
def create_rabbitmq(self, features: List[type[Provider]]) -> RabbitMQApplication:
|
||||
return RabbitMQApplication(RabbitMQKernel(), features)
|
||||
27
shared/application/factory/logger.py
Normal file
27
shared/application/factory/logger.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import logging
|
||||
|
||||
from sys import stdout
|
||||
|
||||
|
||||
class Logger:
|
||||
def create_stdout(
|
||||
self,
|
||||
name: str,
|
||||
level: int = logging.INFO
|
||||
) -> logging.Logger:
|
||||
logger = logging.getLogger(name)
|
||||
logger.setLevel(level)
|
||||
|
||||
handler = logging.StreamHandler(stdout)
|
||||
handler.setLevel(level)
|
||||
handler.setFormatter(
|
||||
logging.Formatter(
|
||||
"%(asctime)s - %(levelname)s - %(message)s",
|
||||
datefmt="%Y-%m-%d %H:%M:%S"
|
||||
)
|
||||
)
|
||||
|
||||
logger.addHandler(handler)
|
||||
|
||||
return logger
|
||||
|
||||
Reference in New Issue
Block a user