Skip to content

Commit

Permalink
Add logger in import
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishabh17 committed Jun 12, 2024
1 parent 766beb3 commit 8393600
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/mappings/imports/modules/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import math
import logging
from typing import List
from datetime import (
datetime,
Expand All @@ -20,6 +21,10 @@
from apps.accounting_exports.models import Error


logger = logging.getLogger(__name__)
logger.level = logging.INFO


class Base:
"""
The Base class for all the modules
Expand Down Expand Up @@ -299,6 +304,8 @@ def post_to_fyle_and_sync(self, fyle_payload: List[object], resource_class, is_l
:param is_last_batch: bool
:param import_log: ImportLog object
"""
logger.info("| Importing {} to Fyle | Content: {{WORKSPACE_ID: {} Fyle Payload count: {} is_last_batch: {}}}".format(self.destination_field, self.workspace_id, len(fyle_payload), is_last_batch))

if fyle_payload and self.platform_class_name in ['expense_custom_fields', 'merchants']:
resource_class.post(fyle_payload)
elif fyle_payload:
Expand Down

0 comments on commit 8393600

Please sign in to comment.