Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easier way to get pretty printing of Metrics #105

Closed
antonkulaga opened this issue Mar 7, 2017 · 2 comments
Closed

easier way to get pretty printing of Metrics #105

antonkulaga opened this issue Mar 7, 2017 · 2 comments
Milestone

Comments

@antonkulaga
Copy link

Wrinting things like

val writer = new PrintWriter(new OutputStreamWriter(System.out))

is very cumbersome. And it often fails when you run it in SparkNotebook. Why not just giving Seq[String] that can be printed with mkString("\n") if needed?

@antonkulaga
Copy link
Author

antonkulaga commented Mar 7, 2017

I've tried to write a simple function that returns string but it did not work

  def prettyPrint() = {
    import java.io.{PrintWriter, StringWriter}
    val stringWriter = new StringWriter()
    val writer = new PrintWriter(stringWriter)
    val result = stringWriter.toString
    writer.close()
    result
  }

@fnothaft fnothaft added this to the 0.2.12 milestone Mar 11, 2017
fnothaft added a commit to fnothaft/bdg-utils that referenced this issue Mar 11, 2017
@fnothaft
Copy link
Member

Hi @antonkulaga! I've opened a proposed fix as PR #112. Would love your thoughts on it!

fnothaft added a commit that referenced this issue Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants