Skip to content

Commit

Permalink
Set the payouts logging levels
Browse files Browse the repository at this point in the history
  • Loading branch information
aracnid committed May 25, 2024
1 parent 038d287 commit 9449fa6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "squaredown"
version = "1.6.3"
version = "1.6.4"
description = "Customized Square interface"
authors = ["Jason Romano <aracnid@gmail.com>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion squaredown/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from squaredown.orders import Orders


__version__ = "1.6.3"
__version__ = "1.6.4"
8 changes: 7 additions & 1 deletion squaredown/logging_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
"squaredown.catalog": {
"level": "DEBUG"
},
"squaredown.itemizations": {
"level": "WARNING"
},
"squaredown.orders": {
"level": "WARNING"
},
"squaredown.payouts": {
"level": "INFO"
},
"urllib3": {
Expand All @@ -38,4 +44,4 @@
"level": "DEBUG",
"handlers": ["console"]
}
}
}
21 changes: 5 additions & 16 deletions squaredown/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def pull(self, **kwargs):

# end if no payouts
if not payouts or len(payouts) == 0:
logger.info('payouts processed: 0')
logger.debug('payouts processed: 0')
return

update_count = 0
Expand All @@ -75,7 +75,7 @@ def pull(self, **kwargs):
# debug, only process one payout
# break

logger.info('payouts processed: %s', update_count)
logger.debug('payouts processed: %s', update_count)

def read(self, **kwargs):
"""Returns a set of Square Payouts.
Expand Down Expand Up @@ -135,7 +135,7 @@ def update_payout(self, payout):
updated_at = payout.get('updated_at')

# log the update
logger.info('update_payout %s: %s', payout_id, updated_at.isoformat()[0:16])
logger.debug('update_payout %s: %s', payout_id, updated_at.isoformat()[0:16])

# apply payout customizations
self.apply_payout_customizations(payout)
Expand Down Expand Up @@ -204,7 +204,7 @@ def pull(self, payout_id: str) -> None:

# end if no payout entries
if not payout_entries or len(payout_entries) == 0:
logger.info('payout entries processed: 0')
logger.debug('payout entries processed: 0')
return

update_count = 0
Expand All @@ -216,7 +216,7 @@ def pull(self, payout_id: str) -> None:
# debug, only process one payout
# break

logger.info('payout entries processed: %s', update_count)
logger.debug('payout entries processed: %s', update_count)

def read(self, payout_id: str) -> list:
"""Returns a set of Square Payout Entries.
Expand Down Expand Up @@ -299,14 +299,3 @@ def apply_payout_entry_customizations(self, payout_entry: dict):
# logger.debug('Applying default customizations: %s', self.collection_name)

return

if __name__ == '__main__':
# setup logging
logger = Logger(__name__).get_logger()

# collection = 'square_payouts'
logger.info('working')

square_payouts = Payouts()
# square_payouts.mdb.square_payout_itemizations.drop()
square_payouts.pull(begin_str='2024-03-05', thru_str='2024-03-11')

0 comments on commit 9449fa6

Please sign in to comment.