Skip to content

Adding DEBUG_INFO setting #560

Open
Open

Description

@noviluni

I was thinking about how to improve the "debugging" process when weird things happen...

And I realized that it could be really useful to add an option to "see" what happens behind the scenes. It could be, for example, a setting called DEBUG_INFO that when True shows relevant information to help you to understand what's happening.

I was trying a little and that's what I got.


Input:

dateparser.parse('07/03/2009')

Log:

Interpretation: 07 - 03 - 2009
Order: month, day, year
Used locale: en

Out:

2009-07-03 00:00:00

Input:

dateparser.parse('2009')

Log:

Missing: Day, Month
Interpretation: 2009
Order: year
Used locale: en

Out:

2009-09-05 00:00:00

Input:

dateparser.parse('Feb 2009')

Log:

Missing: Day
Interpretation: february - 2009
Order: year
Used locale: en

Out:

2009-02-05 00:00:00

Input:

dateparser.parse('07/03/2009', locales=['fr'])

Log:

Interpretation: 07 - 03 - 2009
Order: day, month, year
Used locale: fr

Out:

2009-03-07 00:00:00

Input:

dateparser.parse('en 2 días')

Log:

Used locale: es

Out:

2019-09-07 17:46:02.653798

Of course there are a lot of new information that could appear in the log, that's just an idea.

What do you think?

Activity

  1. noviluni commented on Sep 5, 2019

    @noviluni
    ContributorAuthor

    I just added a draft PR with the code I used to get the log in the examples.

  2. noviluni commented on Sep 5, 2019

    @noviluni
    ContributorAuthor

    It could help in some situations like this: #520 (comment)

  3. noviluni commented on Feb 19, 2020

    @noviluni
    ContributorAuthor

    I expect to continue with this PR after merging this: #603 as it would be a good starting point :)

  4. noviluni commented on Jun 26, 2020

    @noviluni
    ContributorAuthor

    Related to this: #729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions