You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Uri Boness (JIRA)" <ji...@apache.org> on 2010/01/11 20:04:54 UTC

[jira] Created: (SOLR-1716) Add logging support for ScriptTransformer

Add logging support for ScriptTransformer
-----------------------------------------

                 Key: SOLR-1716
                 URL: https://issues.apache.org/jira/browse/SOLR-1716
             Project: Solr
          Issue Type: Improvement
          Components: contrib - DataImportHandler
            Reporter: Uri Boness
             Fix For: 1.5


Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798873#action_12798873 ] 

Erik Hatcher commented on SOLR-1716:
------------------------------------

Couldn't this be done with some kind of script context global or something, rather than adding a logger to the method signature?

And if it is added to the signature, will this work with methods without it too?

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841683#action_12841683 ] 

Lance Norskog commented on SOLR-1716:
-------------------------------------

bq. Is this intended to replace the Rhino built-in "print()" function? I've used that to successfully debug script transformers recently. 

ScriptTransformer supports Rhino,, Groove, Scala, etc. Someday even [Erjang|http://wiki.github.com/krestenkrab/erjang/]. They probably all have such things, but a consistent debugging allows better debugging tools.

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch, SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799186#action_12799186 ] 

Uri Boness commented on SOLR-1716:
----------------------------------

There is still one thing to improve here. Right now a ScriptTransformer is created for each function in the script, which means an engine is created for each function. This can be optimized by creating one script engine per EntityProcessor which each ScriptTransformer will use to execute a dedicated function.

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch, SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841776#action_12841776 ] 

Uri Boness commented on SOLR-1716:
----------------------------------

bq. ScriptTransformer supports Rhino,, Groove, Scala, etc. Someday even Erjang. They probably all have such things, but a consistent debugging allows better debugging tools.

True. Using the logger will print to the same log Solr log files. Indeed it's great for debugging, but also when you have fancy complex logic in the scripts general purpose logging (e.g. INFO, ERROR, TRACE) should also be considered.

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch, SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uri Boness updated SOLR-1716:
-----------------------------

    Attachment: SOLR-1716.patch

This patch puts the logger in the global scope, so you don't have to specify the logger as part of the function signature. It also cleans up the code the related classes a bit.

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch, SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798885#action_12798885 ] 

Erik Hatcher commented on SOLR-1716:
------------------------------------

good enough for me, with the flexible signature handling.  :)

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uri Boness updated SOLR-1716:
-----------------------------

    Attachment: SOLR-1716.patch

Basic implementation

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798896#action_12798896 ] 

Uri Boness commented on SOLR-1716:
----------------------------------

working on a new patch to put the logging in a global context (and cleaning up the code a bit)

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Michael Henson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841659#action_12841659 ] 

Michael Henson commented on SOLR-1716:
--------------------------------------

Is this intended to replace the Rhino built-in "print()" function? I've used that to successfully debug script transformers recently.

> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch, SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1716) Add logging support for ScriptTransformer

Posted by "Uri Boness (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798884#action_12798884 ] 

Uri Boness commented on SOLR-1716:
----------------------------------

yeah, I thought about the global context as well, but this was just something that I implemented anyway (as I needed it myself) and it works. You don't have to supply the logger, but if you do you need to specify the full method signature, that is:
{code}
function(row, context, logger) {

}
{code}

but the following will work as well:
{code}
function(row, context) {

}
{code}
and
{code}
function(row) {

}
{code}


> Add logging support for ScriptTransformer
> -----------------------------------------
>
>                 Key: SOLR-1716
>                 URL: https://issues.apache.org/jira/browse/SOLR-1716
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Uri Boness
>             Fix For: 1.5
>
>         Attachments: SOLR-1716.patch
>
>
> Currently it's very hard to debug the logic embedded in the script ran by the ScriptTransformer. There should be a possibility to add a logger to the function signature, which can be used for logging.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.