Bug #2600

RSB logger 'columns' style not working as described in help

Added by N. Köster almost 8 years ago. Updated almost 8 years ago.

Status:ResolvedStart date:07/13/2016
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Common Lisp Tools
Target version:rsb-0.15

Description

The examples for a logger with the style 'columns' states

[...]
 -s, --style=SPEC            Specify a formatting style that should be used to print events. SPEC has to be of the form

                                KIND KEY1 VALUE1 KEY2 VALUE2 ...

                              where keys and values are optional and depend on KIND. Examples (note that the single quotes have to be included only when used within a shell):

                                --style detailed
                                --style compact
                                --style 'compact :separator "|"'
                                --style 'columns :columns (:now (:scope :width 12) :id :newline)'
                                (see extended help, enable with --help-for=columns, for an explanation of the :columns argument)

[...]

This leads to the following error:

[nkoester @ lax] [34588/0] [10:35:07 - 13.07.16] 
[/homes/nkoester/] /vol/toolkit/nightly/trusty/x86_64/successful/bin/rsb-toolscl0.14 logger --on-error continue --style 'columns :columns (:now (:scope :width 12) :id :newline)' /
 <WARN> [10:35:10] [main thread] rsb.tools.common error-handling.lisp (continue/verbose) - No CONTINUE restart; Cannot recover. Error:

  | Failed to create style according to specification
  |
  |   :COLUMNS :COLUMNS (:NOW (:SCOPE :WIDTH 12) :ID :NEWLINE)
  |
  | . Caused by:
  | > The combination of initargs
  | > 
  | >   :WIDTHS (:RANGE 8)
  | >   :WIDTH  12
  | > 
  | > is invalid for class RSB.FORMATTING:WIDTH-SPECIFICATION-MIXIN.

  .
Failed to create style according to specification

  :COLUMNS :COLUMNS (:NOW (:SCOPE :WIDTH 12) :ID :NEWLINE)

. Caused by:
> The combination of initargs
> 
>   :WIDTHS (:RANGE 8)
>   :WIDTH  12
> 
> is invalid for class RSB.FORMATTING:WIDTH-SPECIFICATION-MIXIN.

[nkoester @ lax] [34588/0] [10:35:10 - 13.07.16] 
[/homes/nkoester/] 

A modification such as

[nkoester @ lax] [34588/0] [10:39:12 - 13.07.16] 
[/homes/nkoester/] /vol/toolkit/nightly/trusty/x86_64/successful/bin/rsb-toolscl0.14 logger --on-error continue --style 'columns :columns (:scope :id :newline)' /

also yields many warnings:

 <WARN> [10:39:12] [main thread] rsb.tools.common error-handling.lisp (continue/verbose) - Error encountered; Recovering via restart

  | CONTINUE: Ignore the failure and continue processing.

  . Further processing may yield partial or incorrect results. Error was:

  | Argument X is not a REAL: NIL

  .
 <WARN> [10:39:12] [main thread] rsb.tools.common error-handling.lisp (continue/verbose) - Error encountered; Recovering via restart

  | CONTINUE: Ignore the failure and continue processing.

  . Further processing may yield partial or incorrect results. Error was:

  | Argument X is not a REAL: NIL

  .
 <WARN> [10:39:12] [main thread] rsb.tools.common error-handling.lisp (continue/verbose) - Error encountered; Recovering via restart

  | CONTINUE: Ignore the failure and continue processing.

  . Further processing may yield partial or incorrect results. Error was:

  | Argument X is not a REAL: NIL

The same also happens when using RSB 0.13 tools

Associated revisions

Revision 54ad5f94
Added by J. Moringen almost 8 years ago

Fixed width specification handling in src/formatting/text-style-mixins.lisp

refs #2600

  • src/formatting/types.lisp (header): updated copyright
    (compatible-with-width-specification?): new function; check whether a
    given width is compatible with a width specification
  • src/formatting/text-style-mixins.lisp
    (shared-initialize :before width-specification-mixin t): allow
    simultaneous :widths and :width as long as they compatible via
    `compatible-with-width-specification?'
    (shared-initialize :after width-specification-mixin t): expect :widths
    and :width to be both supplied; :width prevails in that case
  • src/formatting/package.lisp (package rsb.formatting): added exported
    symbols width-specification? and compatible-with-width-specification?
  • test/formatting/text-style-mixins.lisp
    (test width-specification-mixin-root::construction): adapted to
    changed behavior

Revision 99e73ddb
Added by J. Moringen almost 8 years ago

Fixed column width computation in src/formatting/event-style-columns.lisp

fixes #2600

  • src/formatting/event-style-columns.lisp (header): updated copyright
    (format-event t style-columns t): new method; compute columns widths
    before formatting events
  • src/formatting/event-style-statistics.lisp
    (format-event eql :trigger style-statistics t): simplified
  • test/formatting/style-columns.lisp: new file; contains tests for the
    `style-columns' class
  • cl-rsb-formatting.asd (system cl-rsb-formatting-test): added file
    test/formatting/style-columns.lisp
  • CMakeLists.txt: added columns style to styles test

Revision e649156e
Added by J. Moringen almost 8 years ago

Backport: Fixed width specification handling in src/formatting/text-style-mixins.lisp

refs #2600

  • src/formatting/types.lisp (header): updated copyright
    (compatible-with-width-specification?): new function; check whether a
    given width is compatible with a width specification
  • src/formatting/text-style-mixins.lisp
    (shared-initialize :before width-specification-mixin t): allow
    simultaneous :widths and :width as long as they compatible via
    `compatible-with-width-specification?'
    (shared-initialize :after width-specification-mixin t): expect :widths
    and :width to be both supplied; :width prevails in that case
  • src/formatting/package.lisp (package rsb.formatting): added exported
    symbols width-specification? and compatible-with-width-specification?
  • test/formatting/text-style-mixins.lisp
    (test width-specification-mixin-root::construction): adapted to
    changed behavior

(cherry picked from commit 54ad5f94b86c2d2c1111b3ee0ae05d9d7a285b94)

Revision 1748ce2d
Added by J. Moringen almost 8 years ago

Backport: Fixed column width computation in src/formatting/event-style-columns.lisp

refs #2600

  • src/formatting/event-style-columns.lisp (header): updated copyright
    (format-event t style-columns t): new method; compute columns widths
    before formatting events
  • src/formatting/event-style-statistics.lisp
    (format-event eql :trigger style-statistics t): simplified
  • test/formatting/style-columns.lisp: new file; contains tests for the
    `style-columns' class
  • cl-rsb-formatting.asd (system cl-rsb-formatting-test): added file
    test/formatting/style-columns.lisp
  • CMakeLists.txt: added columns style to styles test

(cherry picked from commit 99e73ddb280cf3213b0959d7aafbee74ad35b502)

Revision c1fdfcc8
Added by J. Moringen almost 8 years ago

Backport: Fixed width specification handling in src/formatting/text-style-mixins.lisp

refs #2600

  • src/formatting/types.lisp (header): updated copyright
    (compatible-with-width-specification?): new function; check whether a
    given width is compatible with a width specification
  • src/formatting/text-style-mixins.lisp
    (shared-initialize :before width-specification-mixin t): allow
    simultaneous :widths and :width as long as they compatible via
    `compatible-with-width-specification?'
    (shared-initialize :after width-specification-mixin t): expect :widths
    and :width to be both supplied; :width prevails in that case
  • src/formatting/package.lisp (package rsb.formatting): added exported
    symbols width-specification? and compatible-with-width-specification?
  • test/formatting/text-style-mixins.lisp
    (test width-specification-mixin-root::construction): adapted to
    changed behavior

(cherry picked from commit 54ad5f94b86c2d2c1111b3ee0ae05d9d7a285b94)

Revision 78c46d3d
Added by J. Moringen almost 8 years ago

Backport: Fixed column width computation in src/formatting/event-style-columns.lisp

refs #2600

  • src/formatting/event-style-columns.lisp (header): updated copyright
    (format-event t style-columns t): new method; compute columns widths
    before formatting events
  • src/formatting/event-style-statistics.lisp
    (format-event eql :trigger style-statistics t): simplified
  • test/formatting/style-columns.lisp: new file; contains tests for the
    `style-columns' class
  • cl-rsb-formatting.asd (system cl-rsb-formatting-test): added file
    test/formatting/style-columns.lisp
  • CMakeLists.txt: added columns style to styles test

(cherry picked from commit 99e73ddb280cf3213b0959d7aafbee74ad35b502)

History

#1 Updated by J. Moringen almost 8 years ago

  • Status changed from New to In Progress
  • Target version set to rsb-0.15

#2 Updated by J. Moringen almost 8 years ago

  • % Done changed from 0 to 50

This leads to the following error:

Mixin column width specifications with explicit widths didn't work properly.

I will change the behavior such that:
  • :widths (4 (:range 10 20)) => automatically choose width 4 or a width between 10 and 20 for the column
  • :widths (4 (:range 10 20)) :width 5 => error
  • :widths (4 (:range 10 20)) :width 17 => force width 17 for the column

also yields many warnings:

The columns style was basically broken.

I have a fix for both issues. Should I backport it to any release branches?

#3 Updated by N. Köster almost 8 years ago

J. Moringen wrote:

The columns style was basically broken.

I have a fix for both issues. Should I backport it to any release branches?

Wow! that was quick! Thanks. It would be great if these could be backported to 0.13 and 0.14!

#4 Updated by J. Moringen almost 8 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Also available in: Atom PDF