Giter Site home page Giter Site logo

Comments (6)

andkopp avatar andkopp commented on July 24, 2024

Interesting approach. Can you extend your example on how the validate() method would add loggable messages to the notification (zif_loggable_object)? I assume that the implementation could be a repetition of code that is already implemented in zcl_logger like add(), e()...

from abap-logger.

AlexandreHT avatar AlexandreHT commented on July 24, 2024

You make a point. I was about to write the following enhancement proposition: I think we should extract this code in a functional class (eg zcl_abap_logger_tools).
I see the following advantages:

To my opinion, the RTTS mapping code in the add method is the most valuable part of ABAP-Logger. It could be a co-product of the main zif_logger capability (as a matter of fact, I have multiple logging methods in my company and it would be nice to use this tool class).

NB: I think merging #49 into master is a prerequisite to this.

from abap-logger.

andkopp avatar andkopp commented on July 24, 2024

I agree. RTTS mapping is the most valuable part. And I also agree on avoiding mixing of stateful and stateless code.
So zcl_logger would continue to implement zif_logger and delegate calls on add() to zcl_logger_tools, correct? Probably not an easy task to design the interface between separate those classes.

from abap-logger.

AlexandreHT avatar AlexandreHT commented on July 24, 2024

I was thinking about the following methods:

  • map_sy_to_msg
    • returning a structure with ty/id/no/v1/v2/v3/v4
  • is_struct_name_mappable_to_msg
    • importing a RTTS absolute name (type abap_abstypename)
    • returning a boolean
  • is_struct_mappable_to_msg
    • importing a structure
    • returning a boolean
  • map_structure_to_msg
    • importing a structure
    • returning a structure with ty/id/no/v1/v2/v3/v4
  • map_structure_to_string_table : replaces add_structure
    • importing a (deep) structure
    • returning a table of strings
  • drill_down_into_exception
    • importing exception type ref to cx_root
    • returning a table of exceptions
  • map
    • importing any
    • exporting a structure with ty/id/no/v1/v2/v3/v4
    • exporting a table of strings
    • exporting a table of exceptions

Maybe zcl_abap_logger_data_mapper would be more suitable as a class name.

from abap-logger.

andkopp avatar andkopp commented on July 24, 2024

This makes it much clearer. I like your approach.

from abap-logger.

mbtools avatar mbtools commented on July 24, 2024

Closed by #90

from abap-logger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.