[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15938820#comment-15938820
 ] 

ASF GitHub Bot commented on TOREE-395:
--

Github user asfgit closed the pull request at:

https://github.com/apache/incubator-toree/pull/116


> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15937248#comment-15937248
 ] 

ASF GitHub Bot commented on TOREE-395:
--

GitHub user kevin-bates reopened a pull request:

https://github.com/apache/incubator-toree/pull/116

[TOREE-395] disable cell result output from console

This issue - discussed in 
[TOREE-395](https://issues.apache.org/jira/browse/TOREE-395) (and somewhat in 
[TOREE-380](https://issues.apache.org/jira/browse/TOREE-380)) - essentially 
takes the appropriate portion of PR #104 and delivers it here.  This change 
makes the scala interpreter behave like other interpreters (and kernels) by not 
issuing the cell results to the console (where it is typically captured by the 
Jupyter logging) and could contain sensitive information.

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

$ git pull https://github.com/kevin-bates/incubator-toree 
remove-results-from-output

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

https://github.com/apache/incubator-toree/pull/116.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 #116


commit aee12381ce23fe7d399aa6488486a0f750027915
Author: Kevin Bates 
Date:   2017-03-21T21:45:43Z

[TOREE-395] disable cell result output

commit e610241a7b4caeb3d013e5c195c9030ce521102f
Author: Kevin Bates 
Date:   2017-03-21T23:51:52Z

preserve list of multiOutputStream

commit 9dee732b34140b01aaed81eb04e12fbe2571bacc
Author: Kevin Bates 
Date:   2017-03-22T21:17:47Z

remove multiOutputStream relative to cell results output




> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15937247#comment-15937247
 ] 

ASF GitHub Bot commented on TOREE-395:
--

Github user kevin-bates closed the pull request at:

https://github.com/apache/incubator-toree/pull/116


> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread Kevin Bates (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15937098#comment-15937098
 ] 

Kevin Bates commented on TOREE-395:
---

I tend to agree and will take a look.  A little worried that it will trickle 
across multiple fronts, but that may be a premature comment.

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread Kevin Bates (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15936992#comment-15936992
 ] 

Kevin Bates commented on TOREE-395:
---

Thank you for your input [~mariusvniekerk].  I think this gives us consensus.  
Since the PR is in this state already, I'd say its ready to merge unless there 
are further comments.

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread Marius Van Niekerk (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15936967#comment-15936967
 ] 

Marius Van Niekerk commented on TOREE-395:
--

I'm perfectly fine with it being removed completely.  The degree of pollution 
that spark by default puts in the jupyter log without changing your log4j is 
already intense.

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread Ryan Blue (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15936567#comment-15936567
 ] 

Ryan Blue commented on TOREE-395:
-

I don't think there is a reason to keep it. When using Toree with Jupyter 
notebooks, the user doesn't see the second copy of results. That opens up the 
possibility to print sensitive data as was already pointed out, but, more 
importantly, it pollutes the notebook server log with results that aren't 
useful when you go to look at it. Is there a use case for notebooks that you 
can think of that makes this a useful feature?

The other environment to think about is Jupyter console. When you use Toree 
with the console, everything gets printed as cell output (which my PR 
addresses) and is printed to stdout. That it produces double output is the main 
reason why we disabled it.

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread Chip Senkbeil (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15936446#comment-15936446
 ] 

Chip Senkbeil commented on TOREE-395:
-

I commented on the PR, but yeah I'm in favor of leaving it as an option with 
the default condition being disabled UNLESS one of you has a reason you believe 
that Console.out should be removed entirely.

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-22 Thread Kevin Bates (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15936434#comment-15936434
 ] 

Kevin Bates commented on TOREE-395:
---

[~rdblue] Chip feels removing the ability to capture cell results is a bit 
extreme - so I think we should reach an agreement here.  How about I revert 
back to my original proposal by making inclusion of Console.out conditional 
based on debug tracing?  Then, when you've got your WIP PR in a more complete 
state, we could revisit its removal - since perhaps the cell capture is part of 
the pluggable display apparatus.

My primary stance is that, by default, we NOT capture cell results and that 
enabling such capture essentially requires local filesystem access (so I'd 
prefer the debug condition over a command line condition).

Thoughts?  Comments?

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935590#comment-15935590
 ] 

ASF GitHub Bot commented on TOREE-395:
--

Github user rdblue commented on a diff in the pull request:

https://github.com/apache/incubator-toree/pull/116#discussion_r107310980
  
--- Diff: 
scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
 ---
@@ -48,7 +48,7 @@ class ScalaInterpreter(private val config:Config = 
ConfigFactory.load) extends I
 
protected val lastResultOut = new ByteArrayOutputStream()
 
-   protected val multiOutputStream = MultiOutputStream(List(Console.out, 
lastResultOut))
+   protected val multiOutputStream = MultiOutputStream(List(lastResultOut))
--- End diff --

I think the multiOutputStream can be completely removed rather than using 
it to wrap just one output stream. Instead, lastResultOut should be passed to 
IMain instead of multiOutputStream.


> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935406#comment-15935406
 ] 

ASF GitHub Bot commented on TOREE-395:
--

GitHub user kevin-bates opened a pull request:

https://github.com/apache/incubator-toree/pull/116

[TOREE-395] disable cell result output

This issue - discussed in 
[TOREE-395](https://issues.apache.org/jira/browse/TOREE-395) (and somewhat in 
[TOREE-380](https://issues.apache.org/jira/browse/TOREE-380)) - essentially 
takes the appropriate portion of PR #104 and delivers it here.  This change 
makes the scala interpreter behave like other interpreters (and kernels) by not 
issuing the cell results to the console (where it is typically captured by the 
Jupyter logging) and could contain sensitive information.

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

$ git pull https://github.com/kevin-bates/incubator-toree 
remove-results-from-output

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

https://github.com/apache/incubator-toree/pull/116.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 #116


commit aee12381ce23fe7d399aa6488486a0f750027915
Author: Kevin Bates 
Date:   2017-03-21T21:45:43Z

[TOREE-395] disable cell result output




> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-21 Thread Ryan Blue (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935254#comment-15935254
 ] 

Ryan Blue commented on TOREE-395:
-

Yeah, please do.

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-21 Thread Kevin Bates (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15934841#comment-15934841
 ] 

Kevin Bates commented on TOREE-395:
---

This is great news Ryan - thanks for the update.  I apologize for not taking a 
closer look at the referenced PR.  The more I thought about things and realized 
that the other interpreters (Toree and otherwise) didn't produce this output, 
the more I leaned to removing this capability entirely.

When do you anticipate this PR getting completed?

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-21 Thread Ryan Blue (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15934825#comment-15934825
 ] 

Ryan Blue commented on TOREE-395:
-

Thanks for continuing the discussion on this, Kevin. A few weeks ago, I posted 
a [WIP pull request|https://github.com/apache/incubator-toree/pull/104] with 
what we're currently using that you might be interested in. That addresses a 
few issues, including this one. The approach we took was to get rid of 
multiOutputStream and just use lastResultOut. Normal stderr and stdout printing 
happens just fine, so I think that the only output that gets printed the writer 
passed to IMain is the summary of what ran (e.g. import scala...). Your idea to 
conditionally print the output to the logger should work fine, but is it really 
necessary for people to see this output in the logs? I see no reason to keep it 
this way.

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOREE-395) Provide a way to disable automatic printing of results in Toree Scala

2017-03-20 Thread Kevin Bates (JIRA)

[ 
https://issues.apache.org/jira/browse/TOREE-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15933109#comment-15933109
 ] 

Kevin Bates commented on TOREE-395:
---

I agree that this could be considered a security issue - particularly if the 
logged output is on a different server than the notebook (e.g., using JKG with 
nb2kg).

This appears to be a function of how the output stream is initialized.  
Currently it's setup using both {{Console.out}} and {{ByteArrayOutputStream}}.  
However, if I remove {{Console.out}} from the initialization of 
{{multiOutputStream}} in ScalaInterpreter.scala I still get the results in the 
notebook but do not see the results in the output logs.

I would propose that we change the initialization of {{multiOutputStream}} to 
only add {{Console.out}} if the logger reflects that debug is enabled or add a 
specific option that prevents such logged output.

Comments?

> Provide a way to disable automatic printing of results in Toree Scala
> -
>
> Key: TOREE-395
> URL: https://issues.apache.org/jira/browse/TOREE-395
> Project: TOREE
>  Issue Type: Improvement
>Affects Versions: 0.2.0
>Reporter: Kun Liu
>
> Scala REPL supports a flag, ":silent" to enable/disable automatic printing of 
> results (those messages begin with "res"). This is also supported in Spark 
> shell. But for Toree Scala kernel, this flag is not supported. Thus the 
> result of a cell would be always printed.
> But if there is any logging mechanism, the results would be recorded in a log 
> file, while this may not be desirable. For instance, a user may not want any 
> sensitive data logged when running "dataRDD.take(5)" in a cell.
> Also found the possible source codes for this:
> https://github.com/apache/incubator-toree/blob/master/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
> There are three methods with silent: Boolean = false as parameter.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)