Skip to content

References: ref(String) should provide way to reduce logging output of values #53

@mmichaelis

Description

@mmichaelis

If you want to modify the logging of reference values you can either just silence it using ref() rather than ref(String) or you need to instantiate the SelfDescribingReferenceImpl by yourself and override the method describeValue(Description).

This is for example needed if the toString() method of the value is way to chatty.

Either the value should be truncated automatically at a given length (but what?) or another alternative is to provide a factory method which comes with a matching toString-converter for a given value. Example API:

Reference<MyObject> ref = References.ref("D", new ToStringProvider<MyObject>() {
  public String describe(MyObject m) {
    ...
  });

A default implementation of the ToStringProvider() could just add automatic truncation so both solutions are available.

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