0

When I start a notebook server, there are some log message shows in the backend(the terminal where the ipython notebook command executed). How could I get the error message in the browser?

E.g. In the backend: (I use python to call some java method)

2015-12-09 22:34:33,483 [Thread-2] ERROR SomeErrorMessage - java.io.FileNotFoundException: File does not exist: hdfs://sample/test.txt

But in the browser, it just failed silently without showing anything and return a None value.

How could I get the message above in the notebook(in browser)?

Thanks

user1754197
  • 127
  • 1
  • 9

1 Answers1

0

I found it in this link:Stdout in IPython notebook vs CLI IPython

here is one reason:

When you do os.system, it's not capturing stdout/stderr from the new process. In the terminal, this works, because stdout and stderr just go directly to the terminal, without Python ever knowing about them. In the notebook, it doesn't, because the kernel can only forward stdout/stderr that it knows about.

Another reason is the I misunderstood the error and the log. It has to throw the error for catching other then simply log it.

Community
  • 1
  • 1
user1754197
  • 127
  • 1
  • 9