Importing jax removes logging handlers #12182
-
Hi, I don't seem to be able to log in my project after upgrading jax to 0.3.16. Here's a cut down example:
yields, as expected: however, if I import jax:
Nothing is printed to the console, or the log file. Does anyone have any insight as to why this is happening? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi - I think the issue has to do with JAX using import logging
import absl.logging
absl.logging.info('message from absl')
LOGGER = logging.getLogger("run")
console = logging.StreamHandler()
file = logging.FileHandler(filename="log.log")
logging.basicConfig(level=logging.INFO, handlers=[console, file])
LOGGER.info("test") # Not shown I don't know enough about |
Beta Was this translation helpful? Give feedback.
Hi - I think the issue has to do with JAX using
absl.logging
rather than Python's built-in logging system. I can reproduce the problem by replacing thejax
import with a simple use ofabsl.logging
, which seems to affect subsequent Python logging:I don't know enough about
absl.logging
to know why this is happening (though theabsl.logging
source does appear to modify default logging levels). For what it'…