Comments (6)
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.
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:
- it would simplify zcl_abap_logger
- it would allow these functions to be used elsewhere
- it would match the following Clean ABAP recommendation Don't mix stateful and stateless in the same class
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.
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.
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.
This makes it much clearer. I like your approach.
from abap-logger.
Closed by #90
from abap-logger.
Related Issues (20)
- bal_tt_msg type not exist HOT 1
- callback routine useless HOT 5
- adding syst messages no working for methods i,a,e,w,s of zcl_logger HOT 2
- Importance is not propagated when logging a table HOT 4
- Unit tests use non-existing SLG0 subobject HOT 5
- Limited Test Double Framework compatibility? HOT 2
- BAL-Log-Handle remains after destruction of ABAP-Logger HOT 1
- Misleading Name of Method popup() when providing custom Profile
- Build Hierarchy with Logger HOT 1
- Navigation to the application Log is not working for background jobs HOT 2
- Stale project? HOT 4
- Add support for BAPI_ALM_RETURN message structure HOT 1
- ABAP Logger v2 HOT 16
- Add injector class to match factory methods
- Add entry to log with context don't work if obj_to_log is an instance of a exception class
- Avoid abbreviations: add methods error, warning, info and success HOT 3
- Read messages from log with context HOT 4
- Option to use grid for DISPLAY_AS_POPUP HOT 1
- System message is logged if initial object is passed to as object to log HOT 3
- Open log doesn't save messages with second db connection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abap-logger.