#581: errorlib: improve outline style of invenio.err
-------------------------+-----------------
 Reporter:  simko        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  major        |  Milestone:
Component:  MiscUtil     |    Version:
 Keywords:               |
-------------------------+-----------------
 1) The `invenio.err` log file currently stores messages coming via old
 and via new error logging technique.  They are formatted differently,
 hence it is not very straightforward to parse the file.

 The top-level entries can be discovered by the doing:

 old style:

 {{{
 $ grep ^2011 ~/invenio.err  | head -5
 2011-03-30 10:06:50 --> ERR_BIBFORMAT_IN_FORMAT_ELEMENT : Error in format
 element ADDITIONAL_REPORT_NUMBERS.
 2011-03-30 10:06:50 --> ERR_BIBFORMAT_FORMAT_ELEMENT_NOT_FOUND : Format
 element PRIMARY_REPORT_NUMBER could not be found.
 2011-03-30 10:06:50 --> ERR_BIBFORMAT_IN_FORMAT_ELEMENT : Error in format
 element ADDITIONAL_REPORT_NUMBERS.
 2011-03-30 10:06:50 --> ERR_BIBFORMAT_FORMAT_ELEMENT_NOT_FOUND : Format
 element PRIMARY_REPORT_NUMBER could not be found.
 2011-03-30 10:06:50 --> ERR_BIBFORMAT_IN_FORMAT_ELEMENT : Error in format
 element ADDITIONAL_REPORT_NUMBERS.

 }}}

 new style:

 {{{
 $ grep '^>> ' ~/invenio.err  | head -5
 >> 2011-03-30 08:12:27 -> AttributeError: 'NoneType' object has no
 attribute 'headers_in'
 >> 2011-03-30 08:12:27 -> AttributeError: 'NoneType' object has no
 attribute 'headers_in'
 >> 2011-03-30 08:12:27 -> AttributeError: 'NoneType' object has no
 attribute 'headers_in'
 >> 2011-03-30 08:12:27 -> AttributeError: 'NoneType' object has no
 attribute 'headers_in'
 >> 2011-03-30 08:12:27 -> AttributeError: 'NoneType' object has no
 attribute 'headers_in'
 }}}

 It would be useful to either standardise upon one logging technique
 for every module (which is a bigger task, see ticket:580) or at least
 alter the old logging technique in order to use the same formatting
 style as the new logging technique, so that at least reading
 `invenio.err` would be uniform.

 2) At the same time, we can perhaps improve the outline markup of the
 file.  E.g. one can easily search for what is going on via the
 above-mentioned grepping commands.  However, in order to read the
 exception content, if one opens the file in an outline-friendly
 reader, one can use the greater-than sign as the outline headline
 character. E.g. Emacs users can `M-:` the following one-liner:

 {{{
 (progn (outline-minor-mode 1)(make-local-variable 'outline-regexp)(setq
 outline-regexp ">+"))
 }}}

 However, the outline structure for an item seems perhaps too nested:

 {{{
 >> 2011-03-30 09:59:50 -> IOError: failed to write data...
 >>> User details...
 >>> Traceback details...
 >>>> Frame application in /usr/lib64/python2.4/site-
 packages/invenio/webinterface_handler_wsgi.py at line 372...
 >>>> Frame _profiler in /usr/lib64/python2.4/site-
 packages/invenio/webinterface_handler.py at line 334...
 >>>> Frame _handler in /usr/lib64/python2.4/site-
 packages/invenio/webinterface_handler.py at line 376...
 >>>> Frame _traverse in /usr/lib64/python2.4/site-
 packages/invenio/webinterface_handler.py at line 237...
 >>>> Frame __call__ in /usr/lib64/python2.4/site-
 packages/invenio/websearch_webinterface.py at line 984...
 >>>> Frame perform_request_search in /usr/lib64/python2.4/site-
 packages/invenio/search_engine.py at line 5099...
 >>>> Frame print_records in /usr/lib64/python2.4/site-
 packages/invenio/search_engine.py at line 3584...
 >>>> Frame write in /usr/lib64/python2.4/site-
 packages/invenio/webinterface_handler_wsgi.py at line 133...
 >>>> Frame flush in /usr/lib64/python2.4/site-
 packages/invenio/webinterface_handler_wsgi.py at line 145...
 }}}

 It may be enough to offer less levels there, perhaps all the frame
 stacks can be printed together at the same level.

 We should also fix the leading double greater-than sign and leading
 messages like:

 {{{
 The following problem occurred on <http://inspiretest.cern.ch> (Invenio
 1.0.0-rc0.39-2e43f1f)
 }}}

 that are living outside of the outline structure.

 3) While doing these changes, we may perhaps want to switch to using
 asterisks instead of greater-than sings, so that outlining would work
 out of the box.  (The star being the usual outline heading symbol.)

-- 
Ticket URL: <http://invenio-software.org/ticket/581>
Invenio <http://invenio-software.org>

Reply via email to