should_do_colour_logging

Documentation for eth_defi.coloured_logging.should_do_colour_logging function.

should_do_colour_logging(stream, *, autodetect_docker_log=True)

Determine whether console logging should use ANSI colours.

Parameters
  • stream (TextIO) – Console stream that receives log output.

  • autodetect_docker_log (bool) – Enable colours when the process is inside Docker even if the stream is not a TTY. Enabled by default because Docker Compose preserves ANSI escape sequences in logs -f.

Returns

True if ANSI colour output should be enabled.

Return type

bool