barzerman / barzer

barzer engine code
MIT License
2 stars 0 forks source link

change error reporting format. 5 min effort #588

Closed nchepanov closed 11 years ago

nchepanov commented 11 years ago

now it's

<cmdoutput>
<error stmt="280584">attempt to REDEFINE MACRO test macro ignored</error>

<error type="RULE CLASH">
<rule>site/alpha/1000011/rules.C.2767.test3.xml:280555.0 </rule>
<rule> site/alpha/1000011/rules.C.2767.test3.xml:280542.0</rule>
</error>

.....

could you please add type="REDEFINE MACRO" to the first error.

also is there any other kinds of error, could you please grep for them if any?

linked to https://github.com/barzerman/barsted/issues/448

0xd34df00d commented 11 years ago

How do I grep for any other types of errors? I mean, how do I distinguish between them?

nchepanov commented 11 years ago

I have already done it grep -r -I 'type=\\"' .

clear type message could be very useful, because end user may see it, so could you please add type for all or almost all error messages in barzer ?

This will make our barsted log window more usable and understandable.

0xd34df00d commented 11 years ago

Oh, you meant already provided error types. I thought you wanted to know what error types aren't defined clearly yet.

nchepanov commented 11 years ago

this types mean nothing =) just to make output more accurate same for @stmt attribute in errors like "too many emits in statement number X" this will be much more accurate <error stmt="X" type="TOO MANY EMITS"> To many emits found</error>

0xd34df00d commented 11 years ago

So what do you want, aside from having type="RULE CLASH" for clashes?

nchepanov commented 11 years ago

clashes are ok. basically, in order to display errors I need 3 things:

these are errors that have not enough info (I will add more later):

<error stmt="280584">attempt to REDEFINE MACRO test macro ignored</error> I need type here, I also need the full rule path i.e. site/alpha/1000011/rules.C.2767.test3.xml:280542.0

<error type="ERROR">site/alpha/1000106/rules.E.2719.entities.xml:70039 rejected: number of emits for this statement is 4294967295 and greater than 1024</error> either subnode <rule> or add @rule attribute

It's up to you how to do this. But it should be automatically parsable. otherwise I have to use dirty regexps such as