Skip to content

Commit

Permalink
[create-pull-request] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtools authored and github-actions[bot] committed Jun 23, 2024
1 parent 63c47d8 commit cf6f776
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/#mbtools#cl_logger.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ CLASS /mbtools/cl_logger IMPLEMENTATION.
"these objects could be moved into their own method
"see adt://***/sap/bc/adt/oo/classes/zcl_logger/source/main#start=391,10;end=415,61
symsg TYPE symsg,
syst_buffer TYPE syst,
loggable TYPE REF TO /mbtools/if_loggable_object,
loggable_object_messages TYPE /mbtools/if_loggable_object=>tty_messages.

Expand All @@ -643,7 +642,6 @@ CLASS /mbtools/cl_logger IMPLEMENTATION.
FIELD-SYMBOLS <exception_data> LIKE LINE OF exception_data_table.

" Remember system message since it might get changed inadvertently
syst_buffer = syst.
IF context IS NOT INITIAL.
ASSIGN context TO <context_val>.
formatted_context-value = <context_val>.
Expand Down Expand Up @@ -676,9 +674,7 @@ CLASS /mbtools/cl_logger IMPLEMENTATION.
msg_type = cl_abap_typedescr=>describe_by_data( obj_to_log ).
struct_kind = get_struct_kind( msg_type ).

IF obj_to_log IS INITIAL.
detailed_msg = add_syst_msg( syst_buffer ).
ELSEIF struct_kind = c_struct_kind-syst.
IF struct_kind = c_struct_kind-syst.
detailed_msg = add_syst_msg( obj_to_log ).
ELSEIF struct_kind = c_struct_kind-bapi.
detailed_msg = add_bapi_msg( obj_to_log ).
Expand Down
23 changes: 22 additions & 1 deletion src/#mbtools#cl_logger.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ can_create_anon_log FOR TESTING,
can_log_bapi_meth_message FOR TESTING RAISING cx_static_check,
can_log_bapi_status_result FOR TESTING RAISING cx_static_check,
can_log_detlevel FOR TESTING RAISING cx_static_check,
can_log_exception_with_context FOR TESTING RAISING cx_static_check.
can_log_exception_with_context FOR TESTING RAISING cx_static_check,
nothing_logged_for_empty_obj FOR TESTING RAISING cx_static_check.

ENDCLASS.

Expand Down Expand Up @@ -2008,4 +2009,24 @@ CLASS lcl_test IMPLEMENTATION.

ENDMETHOD.

METHOD nothing_logged_for_empty_obj.
DATA where_used_list TYPE bapiret2-message ##NEEDED.
DATA bapi_msgs TYPE TABLE OF bapiret2.
DATA bapi_msg TYPE bapiret2.

MESSAGE i001(bl) INTO where_used_list
WITH 'This should' '*not*' 'be logged'.
CLEAR where_used_list.

anon_log->add( bapi_msgs ).
cl_abap_unit_assert=>assert_equals( act = anon_log->length( )
exp = 0 ).
anon_log->add( bapi_msg ).
cl_abap_unit_assert=>assert_equals( act = anon_log->length( )
exp = 0 ).
anon_log->add( where_used_list ).
cl_abap_unit_assert=>assert_equals( act = anon_log->length( )
exp = 0 ).
ENDMETHOD.

ENDCLASS.
12 changes: 6 additions & 6 deletions src/#mbtools#if_logger.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INTERFACE /mbtools/if_logger

METHODS add
IMPORTING
obj_to_log TYPE any OPTIONAL
obj_to_log TYPE any DEFAULT sy
context TYPE any OPTIONAL
callback_form TYPE csequence OPTIONAL
callback_prog TYPE csequence OPTIONAL
Expand All @@ -22,7 +22,7 @@ INTERFACE /mbtools/if_logger

METHODS a
IMPORTING
obj_to_log TYPE any OPTIONAL
obj_to_log TYPE any DEFAULT sy
context TYPE any OPTIONAL
callback_form TYPE csequence OPTIONAL
callback_prog TYPE csequence OPTIONAL
Expand All @@ -36,7 +36,7 @@ INTERFACE /mbtools/if_logger

METHODS e
IMPORTING
obj_to_log TYPE any OPTIONAL
obj_to_log TYPE any DEFAULT sy
context TYPE any OPTIONAL
callback_form TYPE csequence OPTIONAL
callback_prog TYPE csequence OPTIONAL
Expand All @@ -50,7 +50,7 @@ INTERFACE /mbtools/if_logger

METHODS w
IMPORTING
obj_to_log TYPE any OPTIONAL
obj_to_log TYPE any DEFAULT sy
context TYPE any OPTIONAL
callback_form TYPE csequence OPTIONAL
callback_prog TYPE csequence OPTIONAL
Expand All @@ -64,7 +64,7 @@ INTERFACE /mbtools/if_logger

METHODS i
IMPORTING
obj_to_log TYPE any OPTIONAL
obj_to_log TYPE any DEFAULT sy
context TYPE any OPTIONAL
callback_form TYPE csequence OPTIONAL
callback_prog TYPE csequence OPTIONAL
Expand All @@ -78,7 +78,7 @@ INTERFACE /mbtools/if_logger

METHODS s
IMPORTING
obj_to_log TYPE any OPTIONAL
obj_to_log TYPE any DEFAULT sy
context TYPE any OPTIONAL
callback_form TYPE csequence OPTIONAL
callback_prog TYPE csequence OPTIONAL
Expand Down

0 comments on commit cf6f776

Please sign in to comment.