From 8cc51f12d840fce7ec88f9bd7c00ade90faa3fb9 Mon Sep 17 00:00:00 2001 From: Fabian Lupa Date: Sat, 7 Oct 2017 19:17:32 +0200 Subject: [PATCH 1/2] Version 0.2.0 --- src/zcl_alog_version.clas.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zcl_alog_version.clas.abap b/src/zcl_alog_version.clas.abap index 9513d93..920df56 100644 --- a/src/zcl_alog_version.clas.abap +++ b/src/zcl_alog_version.clas.abap @@ -7,7 +7,7 @@ CLASS zcl_alog_version DEFINITION PUBLIC SECTION. CONSTANTS: "! Version of abap-log library in major.minor.revision format - gc_version TYPE string VALUE '0.1.1-SNAPSHOT'. + gc_version TYPE string VALUE '0.2.0'. CLASS-METHODS: class_constructor, "! Factory method From cb07a4098dc4dbe511bdbdb70cc28afd5b72c5e9 Mon Sep 17 00:00:00 2001 From: Fabian Lupa Date: Sat, 7 Oct 2017 19:19:58 +0200 Subject: [PATCH 2/2] Update ABAP Doc --- abapdoc/zalog/classes/zcl_alog_adt_logger.html | 18 ++++++++++++++++++ abapdoc/zalog/classes/zcl_alog_bal_logger.html | 2 +- .../zalog/classes/zcl_alog_file_logger.html | 16 ++++++++++++++++ .../zalog/classes/zcl_alog_logger_base.html | 4 ++-- .../classes/zcl_alog_msg_logger_base.html | 4 ++-- .../zalog/classes/zcl_alog_static_logger.html | 2 +- abapdoc/zalog/classes/zcl_alog_version.html | 2 +- .../classes/zcl_alog_example_adt_classrun.html | 1 + .../zcl_alog_example_adt_classrun2.html | 1 + 9 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 abapdoc/zalog/classes/zcl_alog_adt_logger.html create mode 100644 abapdoc/zalog/classes/zcl_alog_file_logger.html create mode 100644 abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun.html create mode 100644 abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun2.html diff --git a/abapdoc/zalog/classes/zcl_alog_adt_logger.html b/abapdoc/zalog/classes/zcl_alog_adt_logger.html new file mode 100644 index 0000000..8a55310 --- /dev/null +++ b/abapdoc/zalog/classes/zcl_alog_adt_logger.html @@ -0,0 +1,18 @@ +Class ZCL_ALOG_ADT_LOGGER

Class ZCL_ALOG_ADT_LOGGER

public inheriting from ZCL_ALOG_MSG_LOGGER_BASE create public

Documentation

Logger for ADT console applications +

+ This logger dynamically uses the OUT-parameter of IF_OO_ADT_CLASSRUN~MAIN for + log output. Static usage is intentionally avoided because the interface is only available as of + ABAP 7.51. +

+ Unfortunately there are some limitations if you expect Java-style console output. These seem to + be 'by design': +
    +
  • Logged output is only transmitted after the main-method has finished + execution
  • +
  • Logged output is not transmitted at all if the application fails with a short dump
  • +
  • Log entries are always separated by an empty line
  • +

Attributes

Visibility and LevelNameDocumentation
private instancemi_console_adapter type ref to LCL_ADAPTER  

Methods

Visibility and LevelNameDocumentation
public instance
constructor
importingio_outtype ref to OBJECT
raisingzcx_alog_argument_null
raisingzcx_alog_illegal_argument
Parameters
io_out Reference to IF_OO_ADT_INTRNL_CLASSRUN as found in + IF_OO_ADT_CLASSRUN~MAIN-OUT +
Class-based Exceptions
zcx_alog_argument_null io_out cannot be null +
zcx_alog_illegal_argument io_out does not implement + IF_OO_ADT_INTRNL_CLASSRUN
protected instanceentry_internal redefinition 
private instance
format_entry
importingiv_texttype CSEQUENCE
io_typetype ref to ZCL_ALOG_ENTRY_TYPE
returningvalue(rv_formatted)type STRING
 
\ No newline at end of file diff --git a/abapdoc/zalog/classes/zcl_alog_bal_logger.html b/abapdoc/zalog/classes/zcl_alog_bal_logger.html index e8d2ee4..cd62a57 100644 --- a/abapdoc/zalog/classes/zcl_alog_bal_logger.html +++ b/abapdoc/zalog/classes/zcl_alog_bal_logger.html @@ -17,4 +17,4 @@
Class-based Exceptions
zcx_alog_bal_error BAL error
public instance
show_log_entries
importingis_profiletype BAL_S_PROF optional
iv_amodaltype ABAP_BOOL optional
raisingzcx_alog_bal_error
Show log entries
Parameters
is_profile Display profile
iv_amodal Amodal dialog -
Class-based Exceptions
zcx_alog_bal_error BAL error
public instancezif_alog_logger~exception redefinition protected instanceentry_internal redefinition protected instanceentry_msg_internal redefinition  \ No newline at end of file +
Class-based Exceptions
zcx_alog_bal_error BAL error
protected instanceentry_internal redefinition protected instanceentry_msg_internal redefinition  \ No newline at end of file diff --git a/abapdoc/zalog/classes/zcl_alog_file_logger.html b/abapdoc/zalog/classes/zcl_alog_file_logger.html new file mode 100644 index 0000000..30353a5 --- /dev/null +++ b/abapdoc/zalog/classes/zcl_alog_file_logger.html @@ -0,0 +1,16 @@ +Class ZCL_ALOG_FILE_LOGGER

Class ZCL_ALOG_FILE_LOGGER

public inheriting from ZCL_ALOG_MSG_LOGGER_BASE create public

Documentation

File logger +

+ Allow logging to a file on the application server. The file handle will be opened and closed + for each logged message. The file will be created if it does not exist. If it does exists the new + entries will be appended. Logical paths are supported. +

Attributes

Visibility and LevelNameDocumentation
private instancemv_path type STRING  

Methods

Visibility and LevelNameDocumentation
public static
from_logical_path
importingiv_logpathtype PATHINTERN
iv_filenametype STRING
returningvalue(ro_logger)type ref to ZCL_ALOG_FILE_LOGGER
raisingzcx_alog_illegal_argument
Get an instance using a logical path +
Parameters
iv_logpath Logical path name +
iv_filename File name +
ro_logger Logger instance +
Class-based Exceptions
zcx_alog_illegal_argument Logical path cannot be used
public instance
constructor
importingiv_pathtype CSEQUENCE
Parameters
iv_path Physical file path on application server
protected instanceentry_internal redefinition 
protected instance
get_formatted_text
importingiv_texttype CSEQUENCE
io_typetype ref to ZCL_ALOG_ENTRY_TYPE
returningvalue(rv_formatted_text)type STRING
Get a formatted log message +

+ Override this method in a subclass for custom formatting. +

+
Parameters
iv_text Message text +
io_type Message type +
rv_formatted_text Formatted text
\ No newline at end of file diff --git a/abapdoc/zalog/classes/zcl_alog_logger_base.html b/abapdoc/zalog/classes/zcl_alog_logger_base.html index e8a4e80..0cc0a76 100644 --- a/abapdoc/zalog/classes/zcl_alog_logger_base.html +++ b/abapdoc/zalog/classes/zcl_alog_logger_base.html @@ -1,7 +1,7 @@ -Class ZCL_ALOG_LOGGER_BASE

Class ZCL_ALOG_LOGGER_BASE

public abstract create public

Documentation

Logger base class +Class ZCL_ALOG_LOGGER_BASE

Class ZCL_ALOG_LOGGER_BASE

public abstract create public

Documentation

Logger base class

Inherit from this class and implement entry_internal for the logging logic. -

Interfaces

zif_alog_attachable
zif_alog_logger final methods ENTRY

Aliases

Visibility and LevelAliasComponent
publicattachZIF_ALOG_ATTACHABLE~ATTACH
publicdebugZIF_ALOG_LOGGER~DEBUG
publicdetachZIF_ALOG_ATTACHABLE~DETACH
publicentryZIF_ALOG_LOGGER~ENTRY
publicerrorZIF_ALOG_LOGGER~ERROR
publicexceptionZIF_ALOG_LOGGER~EXCEPTION
publicinfoZIF_ALOG_LOGGER~INFO
publicwarningZIF_ALOG_LOGGER~WARNING

Attributes

Visibility and LevelNameDocumentation
protected instancemt_attached_loggers TYPE HASHED TABLE OF REF TO zif_alog_logger WITH UNIQUE KEY table_line  
private instancemo_minimal_log_level type ref to ZCL_ALOG_ENTRY_TYPE  

Methods

Visibility and LevelNameDocumentation
public instanceconstructor  
public instance
get_minimal_log_level
returningvalue(ro_type)type ref to ZCL_ALOG_ENTRY_TYPE
Gets the minimal log level +

Interfaces

zif_alog_attachable
zif_alog_logger final methods ENTRY

Attributes

Visibility and LevelNameDocumentation
protected instancemt_attached_loggers TYPE HASHED TABLE OF REF TO zif_alog_logger WITH UNIQUE KEY table_line  
private instancemo_minimal_log_level type ref to ZCL_ALOG_ENTRY_TYPE  

Methods

Visibility and LevelNameDocumentation
public instanceconstructor  
public instance
get_minimal_log_level
returningvalue(ro_type)type ref to ZCL_ALOG_ENTRY_TYPE
Gets the minimal log level
Parameters
ro_type Entry type with the current minimal priority
public instance
set_minimal_log_level
importingio_typetype ref to ZCL_ALOG_ENTRY_TYPE
raisingzcx_alog_argument_null
Sets the minimal log level

If a new log entry's entry type does not have at least the priority of the entry type set diff --git a/abapdoc/zalog/classes/zcl_alog_msg_logger_base.html b/abapdoc/zalog/classes/zcl_alog_msg_logger_base.html index 2cd4ddc..490b12f 100644 --- a/abapdoc/zalog/classes/zcl_alog_msg_logger_base.html +++ b/abapdoc/zalog/classes/zcl_alog_msg_logger_base.html @@ -1,8 +1,8 @@ -Class ZCL_ALOG_MSG_LOGGER_BASE

Class ZCL_ALOG_MSG_LOGGER_BASE

public inheriting from ZCL_ALOG_LOGGER_BASE abstract create public

Documentation

Message logger base class +Class ZCL_ALOG_MSG_LOGGER_BASE

Class ZCL_ALOG_MSG_LOGGER_BASE

public inheriting from ZCL_ALOG_LOGGER_BASE abstract create public

Documentation

Message logger base class

Inherit from this class and implement entry_internal and ideally overwrite entry_msg_internal for the logging logic. -

Interfaces

zif_alog_msg_logger final methods ENTRY_MSG

Aliases

Visibility and LevelAliasComponent
publicdebug_msgZIF_ALOG_MSG_LOGGER~DEBUG_MSG
publicentry_msgZIF_ALOG_MSG_LOGGER~ENTRY_MSG
publicerror_msgZIF_ALOG_MSG_LOGGER~ERROR_MSG
publicinfo_msgZIF_ALOG_MSG_LOGGER~INFO_MSG
publicwarning_msgZIF_ALOG_MSG_LOGGER~WARNING_MSG

Attributes

Visibility and LevelNameDocumentation
private instancemv_block_entry_inform type ABAP_BOOL  

Methods

Visibility and LevelNameDocumentation
protected instance
entry_msg_internal
importingvalue(iv_msgid)type SYST_MSGID default SY-MSGID
value(iv_msgno)type SYST_MSGNO default SY-MSGNO
value(iv_msgty)type SYST_MSGTY default SY-MSGTY
value(iv_msgv1)type SYST_MSGV default SY-MSGV1
value(iv_msgv2)type SYST_MSGV default SY-MSGV2
value(iv_msgv3)type SYST_MSGV default SY-MSGV3
value(iv_msgv4)type SYST_MSGV default SY-MSGV4
raisingzcx_alog_logging_failed
raisingzcx_alog_unsupported_msgty
Internal implementation of zif_alog_msg_logger->entry_msg( ) to do the logging +

Interfaces

zif_alog_msg_logger final methods ENTRY_MSG

Attributes

Visibility and LevelNameDocumentation
private instancemv_block_entry_inform type ABAP_BOOL  

Methods

Visibility and LevelNameDocumentation
protected instance
entry_msg_internal
importingvalue(iv_msgid)type SYST_MSGID default SY-MSGID
value(iv_msgno)type SYST_MSGNO default SY-MSGNO
value(iv_msgty)type SYST_MSGTY default SY-MSGTY
value(iv_msgv1)type SYST_MSGV default SY-MSGV1
value(iv_msgv2)type SYST_MSGV default SY-MSGV2
value(iv_msgv3)type SYST_MSGV default SY-MSGV3
value(iv_msgv4)type SYST_MSGV default SY-MSGV4
raisingzcx_alog_logging_failed
raisingzcx_alog_unsupported_msgty
Internal implementation of zif_alog_msg_logger->entry_msg( ) to do the logging

Default implementation redirects the message to entry( ), overwrite in subclasses to provide message class specific logic. diff --git a/abapdoc/zalog/classes/zcl_alog_static_logger.html b/abapdoc/zalog/classes/zcl_alog_static_logger.html index ad861f9..2e1e814 100644 --- a/abapdoc/zalog/classes/zcl_alog_static_logger.html +++ b/abapdoc/zalog/classes/zcl_alog_static_logger.html @@ -49,7 +49,7 @@

Parameters
ig_any Variable whose relative type name will be the logger prefix
ri_logger Logger instance
public static
get_msg_logger
importingiv_prefixtype CSEQUENCE optional
returningvalue(ri_msg_logger)type ref to ZIF_ALOG_MSG_LOGGER
Get a (prefixed) message logger instance
Parameters
iv_prefix Prefix to use (e. g. class name) -
ri_msg_logger Logger instance
public static
get_msg_logger_for_any
importingig_anytype ANY
returningvalue(ri_msg_logger)type ref to ZIF_ALOG_MSG_LOGGER
Get a prefixed logger for a variablle +
ri_msg_logger Logger instance
public static
get_msg_logger_for_any
importingig_anytype ANY
returningvalue(ri_msg_logger)type ref to ZIF_ALOG_MSG_LOGGER
Get a prefixed logger for a variable
Parameters
ig_any Variable whose relative type name will be the logger prefix
ri_msg_logger Message logger instance
public static
info
importingiv_texttype CSEQUENCE
raisingzcx_alog_logging_failed
Log an informational message
Parameters
iv_text Message text diff --git a/abapdoc/zalog/classes/zcl_alog_version.html b/abapdoc/zalog/classes/zcl_alog_version.html index 8b36efa..f9e61ce 100644 --- a/abapdoc/zalog/classes/zcl_alog_version.html +++ b/abapdoc/zalog/classes/zcl_alog_version.html @@ -1,4 +1,4 @@ -Class ZCL_ALOG_VERSION

Class ZCL_ALOG_VERSION

public final create private

Documentation

Version constants for abap-log

Constants

Visibility and LevelNameDocumentation
public staticgc_version type STRING value '0.1.1-SNAPSHOT' Version of abap-log library in major.minor.revision format

Attributes

Visibility and LevelNameDocumentation
public staticgo_current type ref to ZCL_ALOG_VERSION read only  
public staticgv_is_snapshot type ABAP_BOOL read only  
public staticgv_major type I read only  
public staticgv_minor type I read only  
public staticgv_revision type I read only  
public instancemv_is_snapshot type ABAP_BOOL read only  
public instancemv_major type I read only  
public instancemv_minor type I read only  
public instancemv_revision type I read only  
public instancemv_version type STRING read only  

Methods

Visibility and LevelNameDocumentation
public staticclass_constructor  
public static
compare
importingio_version_atype ref to ZCL_ALOG_VERSION
io_version_btype ref to ZCL_ALOG_VERSION
returningvalue(rv_result)type I
raisingzcx_alog_argument_null
Compare two version instances +Class ZCL_ALOG_VERSION

Class ZCL_ALOG_VERSION

public final create private

Documentation

Version constants for abap-log

Constants

Visibility and LevelNameDocumentation
public staticgc_version type STRING value '0.2.0' Version of abap-log library in major.minor.revision format

Attributes

Visibility and LevelNameDocumentation
public staticgo_current type ref to ZCL_ALOG_VERSION read only  
public staticgv_is_snapshot type ABAP_BOOL read only  
public staticgv_major type I read only  
public staticgv_minor type I read only  
public staticgv_revision type I read only  
public instancemv_is_snapshot type ABAP_BOOL read only  
public instancemv_major type I read only  
public instancemv_minor type I read only  
public instancemv_revision type I read only  
public instancemv_version type STRING read only  

Methods

Visibility and LevelNameDocumentation
public staticclass_constructor  
public static
compare
importingio_version_atype ref to ZCL_ALOG_VERSION
io_version_btype ref to ZCL_ALOG_VERSION
returningvalue(rv_result)type I
raisingzcx_alog_argument_null
Compare two version instances
Parameters
io_version_a Version A
io_version_b Version B
rv_result
    diff --git a/abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun.html b/abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun.html new file mode 100644 index 0000000..ec3f284 --- /dev/null +++ b/abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun.html @@ -0,0 +1 @@ +Class ZCL_ALOG_EXAMPLE_ADT_CLASSRUN

    Class ZCL_ALOG_EXAMPLE_ADT_CLASSRUN

    public final create public

    Documentation

    Example class for ADT console logging

    Interfaces

    if_oo_adt_classrun
    \ No newline at end of file diff --git a/abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun2.html b/abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun2.html new file mode 100644 index 0000000..3c1e360 --- /dev/null +++ b/abapdoc/zalog/zalog_example/classes/zcl_alog_example_adt_classrun2.html @@ -0,0 +1 @@ +Class ZCL_ALOG_EXAMPLE_ADT_CLASSRUN2

    Class ZCL_ALOG_EXAMPLE_ADT_CLASSRUN2

    public final create public

    Documentation

    Example class for ADT console logging 2

    Interfaces

    if_oo_adt_classrun

    Attributes

    Visibility and LevelNameDocumentation
    private staticgi_logger type ref to ZIF_ALOG_MSG_LOGGER  

    Methods

    Visibility and LevelNameDocumentation
    public staticclass_constructor  
    private instancedo_stuff  
    \ No newline at end of file