keiffster / program-y

Python 3.x based AIML 2.0 Chatbot interpreter, framework, related programs and knowledge files
https://keiffster.github.io/program-y/
Other
348 stars 138 forks source link

Is ERROR level of logging in case of absence of token in a set intentional? #234

Closed acriptis closed 4 years ago

acriptis commented 4 years ago

I have a pattern specified like this:

   <category>
        <pattern>
            <set>animal</set>
        </pattern>
        <template>
            <star/>
            is an animal.
        </template>
   </category>

And if I write "Yes" to my bot (or some other phrases) it writes into log the ERROR entry because it tries to match the text with pattern of the animal set:

2019-09-30 12:48:13,240  root       ERROR   [Console] [bot] [brain] [Console] - No word [Yes] found in set [ANIMAL]

I found that this occurs in this line of code: https://github.com/keiffster/program-y/blob/master/src/programy/parser/pattern/nodes/set.py#L138

Is mismatch of token to the set is intentionally marked as ERROR or it better to reimplement as DEBUG? (I suppose it is ok that pattern has not matched). I expect that pattern mismatch in this case should be logged with DEBUG level. Now I grab a lot of ERRORS in logs like this:

2019-09-30 13:46:24,548  root       ERROR   [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [ANIMALS]
2019-09-30 13:46:24,548  root       ERROR   [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [ANIMAL]
2019-09-30 13:46:24,548  root       ERROR   [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [BIRD]
2019-09-30 13:46:24,548  root       ERROR   [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [NUMBERNAME]
2019-09-30 13:46:24,548  root       ERROR   [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [NAME]
2019-09-30 13:46:24,548  root       ERROR   [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [ARTICLE]
2019-09-30 13:46:24,548  root       ERROR   [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [LANGUAGE]
keiffster commented 4 years ago

You are probably right, it’s the wrong logging statement and probably best to move it to a debug or I do statement.

I’ll add it to the next point release

Regards

Keith 07771 597630

On 30 Sep 2019, at 12:32, Alexander Dmitrievskiy notifications@github.com wrote:

 I have a pattern specified like this:

animal

And if I write "Yes" to my bot (or some other phrases) it writes into log the ERROR entry because it tries to match the text with pattern of the animal set:

2019-09-30 12:48:13,240 root ERROR [Console] [bot] [brain] [Console] - No word [Yes] found in set [ANIMAL] I found that this occurs in this line of code: https://github.com/keiffster/program-y/blob/master/src/programy/parser/pattern/nodes/set.py#L138

Is mismatch of token to the set is intentionally marked as ERROR or it better to reimplement as DEBUG? (I suppose it is ok that pattern has not matched). I expect that pattern mismatch in this case should be logged with DEBUG level. Now I grab a lot of ERRORS in logs like this:

2019-09-30 13:46:24,548 root ERROR [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [ANIMALS] 2019-09-30 13:46:24,548 root ERROR [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [ANIMAL] 2019-09-30 13:46:24,548 root ERROR [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [BIRD] 2019-09-30 13:46:24,548 root ERROR [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [NUMBERNAME] 2019-09-30 13:46:24,548 root ERROR [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [NAME] 2019-09-30 13:46:24,548 root ERROR [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [ARTICLE] 2019-09-30 13:46:24,548 root ERROR [Console] [bot] [brain] [Console] - No word [YEXITRESPONSE] found in set [LANGUAGE] — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

acriptis commented 4 years ago

Ok, thanks!