Skip to content

Commit cfce836

Browse files
committed
logging.info needs backport
1 parent e8798a5 commit cfce836

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/allocation/adapters/orm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
from sqlalchemy import (
23
Table, MetaData, Column, Integer, String, Date, ForeignKey,
34
event,
@@ -6,6 +7,7 @@
67

78
from allocation.domain import model
89

10+
logger = logging.getLogger(__name__)
911

1012
metadata = MetaData()
1113

@@ -48,6 +50,7 @@
4850

4951

5052
def start_mappers():
53+
logger.info("Starting mappers")
5154
lines_mapper = mapper(model.OrderLine, order_lines)
5255
batches_mapper = mapper(model.Batch, batches, properties={
5356
'_allocations': relationship(
@@ -63,4 +66,3 @@ def start_mappers():
6366
@event.listens_for(model.Product, 'load')
6467
def receive_load(product, _):
6568
product.events = []
66-

src/allocation/adapters/redis_eventpublisher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313

1414
def publish(channel, event: events.Event):
15-
logging.debug('publishing: channel=%s, event=%s', channel, event)
15+
logging.info('publishing: channel=%s, event=%s', channel, event)
1616
r.publish(channel, json.dumps(asdict(event)))

src/allocation/entrypoints/redis_eventconsumer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
def main():
15+
logger.info('Redis pubsub starting')
1516
bus = bootstrap.bootstrap()
1617
pubsub = r.pubsub(ignore_subscribe_messages=True)
1718
pubsub.subscribe('change_batch_quantity')
@@ -21,7 +22,7 @@ def main():
2122

2223

2324
def handle_change_batch_quantity(m, bus):
24-
logging.debug('handling %s', m)
25+
logger.info('handling %s', m)
2526
data = json.loads(m['data'])
2627
cmd = commands.ChangeBatchQuantity(ref=data['batchref'], qty=data['qty'])
2728
bus.handle(cmd)

0 commit comments

Comments
 (0)