Skip to content

Commit 9cb0e3e

Browse files
authored
Merge pull request #43 from flaiker/0dot2
0.2.0
2 parents 238ee6e + cb07a40 commit 9cb0e3e

10 files changed

+44
-8
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Class ZCL_ALOG_ADT_LOGGER</title><link rel="stylesheet" href="../../../htmldesign/stylesheet.css" type="text/css"></head><body><div id="header"><div id="navigationMenu"><a href="#attributes">Attributes</a> | <a href="#methods">Methods</a></div></div><div id="content"><h2>Class <span class="identifier objectName">ZCL_ALOG_ADT_LOGGER</span></h2><p>public inheriting from ZCL_ALOG_MSG_LOGGER_BASE create public</p><h4>Documentation</h4><span class="abapDocComment"> Logger for ADT console applications
2+
<p>
3+
This logger dynamically uses the <em>OUT</em>-parameter of <em>IF_OO_ADT_CLASSRUN~MAIN</em> for
4+
log output. Static usage is intentionally avoided because the interface is only available as of
5+
ABAP 7.51.
6+
</p>
7+
Unfortunately there are some limitations if you expect Java-style console output. These seem to
8+
be 'by design':
9+
<ul>
10+
<li>Logged output is only transmitted after the <em>main</em>-method has finished
11+
execution</li>
12+
<li>Logged output is not transmitted at all if the application fails with a short dump</li>
13+
<li>Log entries are always separated by an empty line</li>
14+
</ul></span><h4 id="attributes">Attributes</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>private instance</td><td><span class="identifier fieldName">mi_console_adapter</span> type ref to LCL_ADAPTER </td><td>&#160;</td></tr></table><h4 id="methods">Methods</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>public instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">constructor</span> </td></tr><tr><td>importing</td><td><span class="identifier parameterName">io_out</span></td><td>type ref to OBJECT</td></tr><tr><td>raising</td><td colspan="2"><span class="identifier exceptionName">zcx_alog_argument_null</span></td></tr><tr><td>raising</td><td colspan="2"><span class="identifier exceptionName">zcx_alog_illegal_argument</span></td></tr></table></td><td><span class="abapDocComment"> </span><h5>Parameters</h5><table class="methodParametersDocumentation"><tr ><td><span class="identifier parameterName">io_out</span></td><td><span class="abapDocComment"> Reference to <em>IF_OO_ADT_INTRNL_CLASSRUN</em> as found in
15+
<em>IF_OO_ADT_CLASSRUN~MAIN</em>-OUT
16+
</span></td></tr></table><h5>Class-based Exceptions</h5><table class="exceptions"><tr ><td><span class="identifier exceptionName">zcx_alog_argument_null</span></td><td><span class="abapDocComment"> <em>io_out</em> cannot be null
17+
</span></td></tr><tr ><td><span class="identifier exceptionName">zcx_alog_illegal_argument</span></td><td><span class="abapDocComment"> <em>io_out</em> does not implement
18+
<em>IF_OO_ADT_INTRNL_CLASSRUN</em></span></td></tr></table></td></tr><tr ><td>protected instance</td><td><span class="identifier methodName">entry_internal</span> redefinition</td><td>&#160;</td></tr><tr ><td>private instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">format_entry</span> </td></tr><tr><td>importing</td><td><span class="identifier parameterName">iv_text</span></td><td>type CSEQUENCE</td></tr><tr><td></td><td><span class="identifier parameterName">io_type</span></td><td>type ref to ZCL_ALOG_ENTRY_TYPE</td></tr><tr><td>returning</td><td>value(<span class="identifier parameterName">rv_formatted</span>)</td><td>type STRING</td></tr></table></td><td>&#160;</td></tr></table></div></body></html>

abapdoc/zalog/classes/zcl_alog_bal_logger.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
</span></td></tr></table><h5>Class-based Exceptions</h5><table class="exceptions"><tr ><td><span class="identifier exceptionName">zcx_alog_bal_error</span></td><td><span class="abapDocComment"> BAL error</span></td></tr></table></td></tr><tr ><td>public instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">show_log_entries</span> </td></tr><tr><td>importing</td><td><span class="identifier parameterName">is_profile</span></td><td>type BAL_S_PROF optional</td></tr><tr><td></td><td><span class="identifier parameterName">iv_amodal</span></td><td>type ABAP_BOOL optional</td></tr><tr><td>raising</td><td colspan="2"><span class="identifier exceptionName">zcx_alog_bal_error</span></td></tr></table></td><td><span class="abapDocComment"> Show log entries
1818
</span><h5>Parameters</h5><table class="methodParametersDocumentation"><tr ><td><span class="identifier parameterName">is_profile</span></td><td><span class="abapDocComment"> Display profile
1919
</span></td></tr><tr ><td><span class="identifier parameterName">iv_amodal</span></td><td><span class="abapDocComment"> Amodal dialog
20-
</span></td></tr></table><h5>Class-based Exceptions</h5><table class="exceptions"><tr ><td><span class="identifier exceptionName">zcx_alog_bal_error</span></td><td><span class="abapDocComment"> BAL error</span></td></tr></table></td></tr><tr ><td>public instance</td><td><span class="identifier methodName">zif_alog_logger~exception</span> redefinition</td><td>&#160;</td></tr><tr ><td>protected instance</td><td><span class="identifier methodName">entry_internal</span> redefinition</td><td>&#160;</td></tr><tr ><td>protected instance</td><td><span class="identifier methodName">entry_msg_internal</span> redefinition</td><td>&#160;</td></tr></table></div></body></html>
20+
</span></td></tr></table><h5>Class-based Exceptions</h5><table class="exceptions"><tr ><td><span class="identifier exceptionName">zcx_alog_bal_error</span></td><td><span class="abapDocComment"> BAL error</span></td></tr></table></td></tr><tr ><td>protected instance</td><td><span class="identifier methodName">entry_internal</span> redefinition</td><td>&#160;</td></tr><tr ><td>protected instance</td><td><span class="identifier methodName">entry_msg_internal</span> redefinition</td><td>&#160;</td></tr></table></div></body></html>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Class ZCL_ALOG_FILE_LOGGER</title><link rel="stylesheet" href="../../../htmldesign/stylesheet.css" type="text/css"></head><body><div id="header"><div id="navigationMenu"><a href="#attributes">Attributes</a> | <a href="#methods">Methods</a></div></div><div id="content"><h2>Class <span class="identifier objectName">ZCL_ALOG_FILE_LOGGER</span></h2><p>public inheriting from ZCL_ALOG_MSG_LOGGER_BASE create public</p><h4>Documentation</h4><span class="abapDocComment"> File logger
2+
<p>
3+
Allow logging to a file on the application server. The file handle will be opened and closed
4+
for each logged message. The file will be created if it does not exist. If it does exists the new
5+
entries will be appended. Logical paths are supported.
6+
</p></span><h4 id="attributes">Attributes</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>private instance</td><td><span class="identifier fieldName">mv_path</span> type STRING </td><td>&#160;</td></tr></table><h4 id="methods">Methods</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>public static</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">from_logical_path</span> </td></tr><tr><td>importing</td><td><span class="identifier parameterName">iv_logpath</span></td><td>type PATHINTERN</td></tr><tr><td></td><td><span class="identifier parameterName">iv_filename</span></td><td>type STRING</td></tr><tr><td>returning</td><td>value(<span class="identifier parameterName">ro_logger</span>)</td><td>type ref to ZCL_ALOG_FILE_LOGGER</td></tr><tr><td>raising</td><td colspan="2"><span class="identifier exceptionName">zcx_alog_illegal_argument</span></td></tr></table></td><td><span class="abapDocComment"> Get an instance using a logical path
7+
</span><h5>Parameters</h5><table class="methodParametersDocumentation"><tr ><td><span class="identifier parameterName">iv_logpath</span></td><td><span class="abapDocComment"> Logical path name
8+
</span></td></tr><tr ><td><span class="identifier parameterName">iv_filename</span></td><td><span class="abapDocComment"> File name
9+
</span></td></tr><tr ><td><span class="identifier parameterName">ro_logger</span></td><td><span class="abapDocComment"> Logger instance
10+
</span></td></tr></table><h5>Class-based Exceptions</h5><table class="exceptions"><tr ><td><span class="identifier exceptionName">zcx_alog_illegal_argument</span></td><td><span class="abapDocComment"> Logical path cannot be used</span></td></tr></table></td></tr><tr ><td>public instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">constructor</span> </td></tr><tr><td>importing</td><td><span class="identifier parameterName">iv_path</span></td><td>type CSEQUENCE</td></tr></table></td><td><span class="abapDocComment"> </span><h5>Parameters</h5><table class="methodParametersDocumentation"><tr ><td><span class="identifier parameterName">iv_path</span></td><td><span class="abapDocComment"> Physical file path on application server</span></td></tr></table></td></tr><tr ><td>protected instance</td><td><span class="identifier methodName">entry_internal</span> redefinition</td><td>&#160;</td></tr><tr ><td>protected instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">get_formatted_text</span> </td></tr><tr><td>importing</td><td><span class="identifier parameterName">iv_text</span></td><td>type CSEQUENCE</td></tr><tr><td></td><td><span class="identifier parameterName">io_type</span></td><td>type ref to ZCL_ALOG_ENTRY_TYPE</td></tr><tr><td>returning</td><td>value(<span class="identifier parameterName">rv_formatted_text</span>)</td><td>type STRING</td></tr></table></td><td><span class="abapDocComment"> Get a formatted log message
11+
<p>
12+
Override this method in a subclass for custom formatting.
13+
</p>
14+
</span><h5>Parameters</h5><table class="methodParametersDocumentation"><tr ><td><span class="identifier parameterName">iv_text</span></td><td><span class="abapDocComment"> Message text
15+
</span></td></tr><tr ><td><span class="identifier parameterName">io_type</span></td><td><span class="abapDocComment"> Message type
16+
</span></td></tr><tr ><td><span class="identifier parameterName">rv_formatted_text</span></td><td><span class="abapDocComment"> Formatted text</span></td></tr></table></td></tr></table></div></body></html>

abapdoc/zalog/classes/zcl_alog_logger_base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Class ZCL_ALOG_LOGGER_BASE</title><link rel="stylesheet" href="../../../htmldesign/stylesheet.css" type="text/css"></head><body><div id="header"><div id="navigationMenu"><a href="#interfaces">Interfaces</a> | <a href="#aliases">Aliases</a> | <a href="#attributes">Attributes</a> | <a href="#methods">Methods</a></div></div><div id="content"><h2>Class <span class="identifier objectName">ZCL_ALOG_LOGGER_BASE</span></h2><p>public abstract create public</p><h4>Documentation</h4><span class="abapDocComment"> Logger base class
1+
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Class ZCL_ALOG_LOGGER_BASE</title><link rel="stylesheet" href="../../../htmldesign/stylesheet.css" type="text/css"></head><body><div id="header"><div id="navigationMenu"><a href="#interfaces">Interfaces</a> | <a href="#attributes">Attributes</a> | <a href="#methods">Methods</a></div></div><div id="content"><h2>Class <span class="identifier objectName">ZCL_ALOG_LOGGER_BASE</span></h2><p>public abstract create public</p><h4>Documentation</h4><span class="abapDocComment"> Logger base class
22
<p>
33
Inherit from this class and implement <em>entry_internal</em> for the logging logic.
4-
</p></span><h4 id="interfaces">Interfaces</h4> <span class="identifier interfaceName">zif_alog_attachable</span><br/><span class="identifier interfaceName">zif_alog_logger</span> final methods ENTRY<br/><h4 id="aliases">Aliases</h4><table><thead><tr><th>Visibility and Level</th><th>Alias</th><th>Component</th></tr></thead><tr><td>public</td><td><strong>attach</strong></td><td>ZIF_ALOG_ATTACHABLE~ATTACH</td></tr><tr><td>public</td><td><strong>debug</strong></td><td>ZIF_ALOG_LOGGER~DEBUG</td></tr><tr><td>public</td><td><strong>detach</strong></td><td>ZIF_ALOG_ATTACHABLE~DETACH</td></tr><tr><td>public</td><td><strong>entry</strong></td><td>ZIF_ALOG_LOGGER~ENTRY</td></tr><tr><td>public</td><td><strong>error</strong></td><td>ZIF_ALOG_LOGGER~ERROR</td></tr><tr><td>public</td><td><strong>exception</strong></td><td>ZIF_ALOG_LOGGER~EXCEPTION</td></tr><tr><td>public</td><td><strong>info</strong></td><td>ZIF_ALOG_LOGGER~INFO</td></tr><tr><td>public</td><td><strong>warning</strong></td><td>ZIF_ALOG_LOGGER~WARNING</td></tr></table><h4 id="attributes">Attributes</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>protected instance</td><td><span class="identifier fieldName">mt_attached_loggers</span> TYPE HASHED TABLE OF REF TO zif_alog_logger WITH UNIQUE KEY table_line </td><td>&#160;</td></tr><tr ><td>private instance</td><td><span class="identifier fieldName">mo_minimal_log_level</span> type ref to ZCL_ALOG_ENTRY_TYPE </td><td>&#160;</td></tr></table><h4 id="methods">Methods</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>public instance</td><td><span class="identifier methodName">constructor</span> </td><td>&#160;</td></tr><tr ><td>public instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">get_minimal_log_level</span> </td></tr><tr><td>returning</td><td>value(<span class="identifier parameterName">ro_type</span>)</td><td>type ref to ZCL_ALOG_ENTRY_TYPE</td></tr></table></td><td><span class="abapDocComment"> Gets the minimal log level
4+
</p></span><h4 id="interfaces">Interfaces</h4> <span class="identifier interfaceName">zif_alog_attachable</span><br/><span class="identifier interfaceName">zif_alog_logger</span> final methods ENTRY<br/><h4 id="attributes">Attributes</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>protected instance</td><td><span class="identifier fieldName">mt_attached_loggers</span> TYPE HASHED TABLE OF REF TO zif_alog_logger WITH UNIQUE KEY table_line </td><td>&#160;</td></tr><tr ><td>private instance</td><td><span class="identifier fieldName">mo_minimal_log_level</span> type ref to ZCL_ALOG_ENTRY_TYPE </td><td>&#160;</td></tr></table><h4 id="methods">Methods</h4><table><thead><tr><th>Visibility and Level</th><th>Name</th><th>Documentation</th></tr></thead><tr ><td>public instance</td><td><span class="identifier methodName">constructor</span> </td><td>&#160;</td></tr><tr ><td>public instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">get_minimal_log_level</span> </td></tr><tr><td>returning</td><td>value(<span class="identifier parameterName">ro_type</span>)</td><td>type ref to ZCL_ALOG_ENTRY_TYPE</td></tr></table></td><td><span class="abapDocComment"> Gets the minimal log level
55
</span><h5>Parameters</h5><table class="methodParametersDocumentation"><tr ><td><span class="identifier parameterName">ro_type</span></td><td><span class="abapDocComment"> Entry type with the current minimal priority</span></td></tr></table></td></tr><tr ><td>public instance</td><td><table class="methodSignature"><tr><td colspan="3"><span class="identifier methodName">set_minimal_log_level</span> </td></tr><tr><td>importing</td><td><span class="identifier parameterName">io_type</span></td><td>type ref to ZCL_ALOG_ENTRY_TYPE</td></tr><tr><td>raising</td><td colspan="2"><span class="identifier exceptionName">zcx_alog_argument_null</span></td></tr></table></td><td><span class="abapDocComment"> Sets the minimal log level
66
<p>
77
If a new log entry's entry type does not have at least the priority of the entry type set

0 commit comments

Comments
 (0)