Carl Von
Carl Von

Reputation: 178

Python 3.8 Logging Issue

Has anyone ever seen this with logging?

DEBUG:wc_to_db_logger:inactive not_applicable

It occurs whenever I put a wc_to_db_logger.debug() in to my code, even if it is not executed. Very strange I cannot find the error anywhere.

I have added a code snipp-it below. Just placing the wc_to_db_logger.debug in the code under a function causes the issue. It repeats the error 18 times.

            elif source == 'gs':
                try:
                    row_data = gs_worksheet_by_customer_id[self.customer_id]
                except KeyError:
                    continue

                value = row_data[source_name]
                value = convert_gs_to_db(data_type, value)

                if db_value != value:
                    wc_to_db_logger.debug('%s %s' % (db_value, value))
                    setattr(self, attribute_name, value)

Upvotes: 1

Views: 123

Answers (1)

Carl Von
Carl Von

Reputation: 178

I seemed to solve it by adding the following to my logger; wc_to_db_logger.propagate = False

Apparently I need to learn more about the logger. Wish me luck.

* UPDATE *

My fix did not work, it just disabled logging. I will put up a code snippit.

Upvotes: 1

Related Questions