[ 
https://issues.apache.org/jira/browse/IGNITE-8570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16619183#comment-16619183
 ] 

ASF GitHub Bot commented on IGNITE-8570:
----------------------------------------

GitHub user xtern opened a pull request:

    https://github.com/apache/ignite/pull/4786

    IGNITE-8570

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xtern/ignite IGNITE-8570

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/4786.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4786
    
----
commit d9bcad3752feb73988576fb4cc5181c5a7baff0d
Author: voipp <alkuznetsov.sb@...>
Date:   2018-06-28T20:14:54Z

    logger implemented

commit cbb1442ac9cf3a01fad3b7690cc1266ec6f61b55
Author: voipp <alkuznetsov.sb@...>
Date:   2018-07-05T16:18:52Z

    added listener for null-regexp. Removed waitFor

commit 53e4dd678376f0a5a530921e033660bee95f0787
Author: pereslegin-pa <xxtern@...>
Date:   2018-09-18T13:41:52Z

    IGNITE-8570 Code cleanup.

----


> Create lighter version of GridStringLogger
> ------------------------------------------
>
>                 Key: IGNITE-8570
>                 URL: https://issues.apache.org/jira/browse/IGNITE-8570
>             Project: Ignite
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Andrey Kuznetsov
>            Assignee: Alexey Kuznetsov
>            Priority: Major
>             Fix For: 2.7
>
>
> _+Problem with current GridStringLogger implementation+_: 
>  Most usages of {{GridStringLogger}} in test assumes the following scenario. 
> First, it is set as a logger for some Ignite node. 
>  Then, after some activity on that node, log content is searched for some 
> predefined strings. 
>  {{GridStringLogger}} uses {{StringBuilder}} of bounded size internally to 
> store log contents, older contents gets dropped on exaustion. 
>  Thus, changes that add more logging may damage some independent tests that 
> use {{GridStringLogger}}.
>  
> +_The suggestion for new implementation:_+
>  The suggestion is to implement and use another test logger conforming to 
> these requirements:
>  * It does not accumulate any logs(actually, it will print no logs to 
> anywhere)
>  * It allows to set the listener that fires when log message matches certain 
> regular expression, {{Matcher}} can be passed to the listener
>  
> _+Proposed design+_, pseudocode:
> ```
>  Class GridRegexpLogger implements IgniteLogger{
>  …
>  debug(String str){
>  if (/* str matches pattern. */)
>    \{ /* notify listeners. */ }
> }
>  …
>  listen("regexp", IgniteInClosure<String> loggerListener)// listener receives 
> message
> { /* registers listener. */ }
> listenDebug("regexp", loggerListener)
> { /* registers listener for debug output only. */ }
> …
>  }
>  ```
> +_Sample regexp logger usage_+:
> ```
>  GridRegexpLogger logger;
> logger.listen(“regexp”, new GridRegexpListener());
> logger.listenDebug("regexp", new GridRegexpListener());
>  ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to