Skip to content

Conversation

jasongrout
Copy link
Member

Too often I'm trying to track down an errant extra static file path (like some javascript installed in some obscure place). This makes it easy to see exactly what is being served.

@jasongrout
Copy link
Member Author

jasongrout commented Dec 1, 2016

CC @dmadeka

@jasongrout
Copy link
Member Author

Perhaps log() doesn't have to be a function? I'm not sure what the specific lifetime concerns are with the application initialization check. @minrk - would the following work just as well?

    if Application.initialized():
        log = Application.instance().log
    else:
        log = app_log

at the top level?

@minrk minrk added this to the 4.3 milestone Dec 2, 2016
@takluyver
Copy link
Member

@jasongrout FileFindHandler, which you're modifying, inherits from IPythonHandler, which defines the log property. So you should be able to use self.log.debug(...), I think, without needing an extra function.

The application won't be initialised at import time, so putting that check at the top level of the module wouldn't work.

@minrk
Copy link
Member

minrk commented Dec 5, 2016

Arg, I wrote a whole comment last week, but apparently GitHub lost it. What @takluyver said - module-level initialization won't work because import happens too early. This function is fine as-is. @takluyver it's needed here because this method is required to be a classmethod.

@minrk minrk merged commit 38060d0 into master Dec 5, 2016
@minrk minrk deleted the static-file-log branch December 5, 2016 09:14
@gnestor gnestor mentioned this pull request Dec 7, 2016
12 tasks
@gnestor
Copy link
Contributor

gnestor commented Dec 7, 2016

@jasongrout Does this need to be backported before releasing 4.3?

minrk added a commit to minrk/notebook that referenced this pull request Dec 8, 2016
Too often I'm trying to track down an errant extra static file path (like some javascript installed in some obscure place). This makes it easy to see exactly what is being served.

Signed-off-by: Min RK <benjaminrk@gmail.com>
@minrk
Copy link
Member

minrk commented Dec 8, 2016

Backported

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants