Skip to content

Commit

Permalink
Automatic Update LOGGER (#66)
Browse files Browse the repository at this point in the history
Automatic update from mirror
https://github.com/Marc-Bernard-Tools/Mirror-LOGGER

Co-authored-by: mbtools <mbtools@users.noreply.github.com>
Co-authored-by: Marc Bernard <59966492+mbtools@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 19, 2024
1 parent fe06806 commit e5d8cdb
Show file tree
Hide file tree
Showing 23 changed files with 1,091 additions and 196 deletions.
543 changes: 420 additions & 123 deletions src/log/#mbtools#cl_logger.clas.abap

Large diffs are not rendered by default.

432 changes: 410 additions & 22 deletions src/log/#mbtools#cl_logger.clas.testclasses.abap

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/log/#mbtools#cl_logger.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VSEOCLASS>
<CLSNAME>/MBTOOLS/CL_LOGGER</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>MBT Logger</DESCRIPT>
<DESCRIPT>MBT ABAP Logger</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
Expand Down
2 changes: 1 addition & 1 deletion src/log/#mbtools#cl_logger_collection.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VSEOCLASS>
<CLSNAME>/MBTOOLS/CL_LOGGER_COLLECTION</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>MBT Logger Collection</DESCRIPT>
<DESCRIPT>MBT ABAP Logger: Collection</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
Expand Down
6 changes: 5 additions & 1 deletion src/log/#mbtools#cl_logger_disp_prof.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ CLASS /mbtools/cl_logger_disp_prof IMPLEMENTATION.
colpos = colpos + 1.

ENDLOOP.

r_self = me.
ENDMETHOD.

METHOD /mbtools/if_logger_disp_prof~set_context_tree.
Expand Down Expand Up @@ -154,6 +156,8 @@ CLASS /mbtools/cl_logger_disp_prof IMPLEMENTATION.
lev_sort-up = 'X'.
lev_sort-spos = 1.
APPEND lev_sort TO <lev2_sort>.

r_self = me.
ENDMETHOD.

METHOD /mbtools/if_logger_disp_prof~set_grid.
Expand All @@ -173,7 +177,7 @@ CLASS /mbtools/cl_logger_disp_prof IMPLEMENTATION.
ELSE.
RAISE EXCEPTION TYPE /mbtools/cx_logger_disp_prof
EXPORTING
info = |field { i_fld } does not exist| ##no_text.
info = |field { i_fld } does not exist| ##NO_TEXT.
ENDIF.

ENDMETHOD.
Expand Down
4 changes: 2 additions & 2 deletions src/log/#mbtools#cl_logger_disp_prof.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VSEOCLASS>
<CLSNAME>/MBTOOLS/CL_LOGGER_DISP_PROF</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>MBT ABAP Logger: Display profile</DESCRIPT>
<DESCRIPT>MBT ABAP Logger: Display Profile</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
Expand All @@ -16,7 +16,7 @@
<CMPNAME>GET_STRUCTURE_COMPONENTS</CMPNAME>
<SCONAME>R_COMPONENTS</SCONAME>
<LANGU>E</LANGU>
<DESCRIPT>Komponentenbeschreibungstabelle</DESCRIPT>
<DESCRIPT>Component Descriptions</DESCRIPT>
</SEOSUBCOTX>
</DESCRIPTIONS_SUB>
</asx:values>
Expand Down
88 changes: 64 additions & 24 deletions src/log/#mbtools#cl_logger_factory.clas.abap
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CLASS /mbtools/cl_logger_factory DEFINITION
PUBLIC
FINAL
CREATE PRIVATE.
CREATE PRIVATE
GLOBAL FRIENDS /mbtools/cl_logger_injector.

************************************************************************
* abap logger
Expand Down Expand Up @@ -53,26 +54,67 @@ CLASS /mbtools/cl_logger_factory DEFINITION
i_standard TYPE clike DEFAULT abap_true
RETURNING
VALUE(r_display_profile) TYPE REF TO /mbtools/if_logger_disp_prof.

PROTECTED SECTION.
PRIVATE SECTION.

CLASS-DATA:
log_logger TYPE REF TO /mbtools/if_logger,
log_settings TYPE REF TO /mbtools/if_logger_settings,
log_collection TYPE REF TO /mbtools/if_logger_collection,
log_display_profile TYPE REF TO /mbtools/if_logger_disp_prof.

ENDCLASS.



CLASS /mbtools/cl_logger_factory IMPLEMENTATION.


METHOD create_collection.
IF log_collection IS INITIAL.
CREATE OBJECT r_collection TYPE /mbtools/cl_logger_collection.
ELSE.
r_collection = log_collection.
ENDIF.
ENDMETHOD.


METHOD create_display_profile.
IF log_display_profile IS INITIAL.
CREATE OBJECT r_display_profile TYPE /mbtools/cl_logger_disp_prof.
ELSE.
r_display_profile = log_display_profile.
ENDIF.

r_display_profile->set(
i_detlevel = i_detlevel
i_no_tree = i_no_tree
i_popup = i_popup
i_single_log = i_single_log
i_standard = i_standard ).
ENDMETHOD.


METHOD create_log.
FIELD-SYMBOLS <context_val> TYPE c.

DATA lo_log TYPE REF TO /mbtools/cl_logger.
CREATE OBJECT lo_log.

IF log_logger IS INITIAL.
CREATE OBJECT lo_log TYPE /mbtools/cl_logger.
ELSE.
lo_log ?= log_logger.
ENDIF.

lo_log->header-object = object.
lo_log->header-subobject = subobject.
lo_log->header-extnumber = desc.

IF settings IS BOUND.
lo_log->settings = settings.
ELSE.
CREATE OBJECT lo_log->settings TYPE /mbtools/cl_logger_settings.
lo_log->settings = create_settings( ).
ENDIF.

" Special case: Logger can work without object - but then the data cannot be written to the database.
Expand Down Expand Up @@ -115,10 +157,16 @@ CLASS /mbtools/cl_logger_factory IMPLEMENTATION.
r_log = lo_log.
ENDMETHOD.


METHOD create_settings.
CREATE OBJECT r_settings TYPE /mbtools/cl_logger_settings.
IF log_settings IS INITIAL.
CREATE OBJECT r_settings TYPE /mbtools/cl_logger_settings.
ELSE.
r_settings = log_settings.
ENDIF.
ENDMETHOD.


METHOD open_log.
DATA: filter TYPE bal_s_lfil,
l_object TYPE balobj_d,
Expand Down Expand Up @@ -150,9 +198,10 @@ CLASS /mbtools/cl_logger_factory IMPLEMENTATION.

IF sy-subrc = 1.
IF create_if_does_not_exist = abap_true.
r_log = /mbtools/cl_logger=>new( object = object
subobject = subobject
desc = desc ).
r_log = create_log( object = object
subobject = subobject
desc = desc
settings = settings ).
ENDIF.
RETURN.
ENDIF.
Expand All @@ -164,14 +213,20 @@ CLASS /mbtools/cl_logger_factory IMPLEMENTATION.
READ TABLE found_headers INDEX 1 INTO most_recent_header.


CREATE OBJECT lo_log.

IF log_logger IS INITIAL.
CREATE OBJECT lo_log TYPE /mbtools/cl_logger.
ELSE.
lo_log ?= log_logger.
ENDIF.

lo_log->db_number = most_recent_header-lognumber.
lo_log->handle = most_recent_header-log_handle.

IF settings IS BOUND.
lo_log->settings = settings.
ELSE.
CREATE OBJECT lo_log->settings TYPE /mbtools/cl_logger_settings.
lo_log->settings = create_settings( ).
ENDIF.

CALL FUNCTION 'BAL_DB_LOAD'
Expand All @@ -186,19 +241,4 @@ CLASS /mbtools/cl_logger_factory IMPLEMENTATION.

r_log = lo_log.
ENDMETHOD.

METHOD create_collection.
CREATE OBJECT r_collection TYPE /mbtools/cl_logger_collection.
ENDMETHOD.

METHOD create_display_profile.
CREATE OBJECT r_display_profile TYPE /mbtools/cl_logger_disp_prof.
r_display_profile->set(
i_detlevel = i_detlevel
i_no_tree = i_no_tree
i_popup = i_popup
i_single_log = i_single_log
i_standard = i_standard ).
ENDMETHOD.

ENDCLASS.
2 changes: 1 addition & 1 deletion src/log/#mbtools#cl_logger_factory.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VSEOCLASS>
<CLSNAME>/MBTOOLS/CL_LOGGER_FACTORY</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>MBT Logger Factory</DESCRIPT>
<DESCRIPT>MBT ABAP Logger: Factory</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
Expand Down
59 changes: 59 additions & 0 deletions src/log/#mbtools#cl_logger_injector.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
CLASS /mbtools/cl_logger_injector DEFINITION
PUBLIC
FINAL
FOR TESTING
CREATE PUBLIC.

************************************************************************
* abap logger
*
* Copyright 2017 Eric Peterson <https://github.com/ABAP-Logger/ABAP-Logger>
* SPDX-License-Identifier: MIT
************************************************************************

PUBLIC SECTION.

CLASS-METHODS set_logger
IMPORTING
logger TYPE REF TO /mbtools/if_logger.

CLASS-METHODS set_settings
IMPORTING
settings TYPE REF TO /mbtools/if_logger_settings.

CLASS-METHODS set_collection
IMPORTING
collection TYPE REF TO /mbtools/if_logger_collection.

CLASS-METHODS set_display_profile
IMPORTING
display_profile TYPE REF TO /mbtools/if_logger_disp_prof.

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.



CLASS /mbtools/cl_logger_injector IMPLEMENTATION.


METHOD set_collection.
/mbtools/cl_logger_factory=>log_collection = collection.
ENDMETHOD.


METHOD set_display_profile.
/mbtools/cl_logger_factory=>log_display_profile = display_profile.
ENDMETHOD.


METHOD set_logger.
/mbtools/cl_logger_factory=>log_logger = logger.
ENDMETHOD.


METHOD set_settings.
/mbtools/cl_logger_factory=>log_settings = settings.
ENDMETHOD.
ENDCLASS.
17 changes: 17 additions & 0 deletions src/log/#mbtools#cl_logger_injector.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>/MBTOOLS/CL_LOGGER_INJECTOR</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>MBT ABAP Logger: Injector</DESCRIPT>
<CATEGORY>05</CATEGORY>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>
35 changes: 35 additions & 0 deletions src/log/#mbtools#cl_logger_manifest.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CLASS /mbtools/cl_logger_manifest DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.

************************************************************************
* abap logger
*
* Copyright 2017 Eric Peterson <https://github.com/ABAP-Logger/ABAP-Logger>
* SPDX-License-Identifier: MIT
************************************************************************

PUBLIC SECTION.

INTERFACES if_apack_manifest.

METHODS constructor.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.



CLASS /mbtools/cl_logger_manifest IMPLEMENTATION.


METHOD constructor.

if_apack_manifest~descriptor-group_id = 'github.com/ABAP-Logger'.
if_apack_manifest~descriptor-artifact_id = 'ABAP-Logger'.
if_apack_manifest~descriptor-version = '1.0.0'.
if_apack_manifest~descriptor-git_url = 'https://github.com/ABAP-Logger/ABAP-Logger'.

ENDMETHOD.
ENDCLASS.
23 changes: 23 additions & 0 deletions src/log/#mbtools#cl_logger_manifest.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>/MBTOOLS/CL_LOGGER_MANIFEST</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>MBT ABAP-Logger: Apack Manifest</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
<DESCRIPTIONS>
<SEOCOMPOTX>
<CMPNAME>CONSTRUCTOR</CMPNAME>
<LANGU>E</LANGU>
<DESCRIPT>CONSTRUCTOR</DESCRIPT>
</SEOCOMPOTX>
</DESCRIPTIONS>
</asx:values>
</asx:abap>
</abapGit>
Loading

0 comments on commit e5d8cdb

Please sign in to comment.