Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import logging
import daiquiri
import daiquiri.formatter
daiquiri.setup(level=logging.INFO, outputs=(
daiquiri.output.Stream(formatter=daiquiri.formatter.ColorFormatter(
fmt=(daiquiri.formatter.DEFAULT_FORMAT +
" [%(subsystem)s is %(mood)s]"))),
))
logger = daiquiri.getLogger(__name__, subsystem="example")
logger.info("It works and log to stderr by default with color!",
mood="happy")
def main():
args = build_parser().parse_args()
daiquiri.setup(
outputs=(
daiquiri.output.Stream(
sys.stdout,
formatter=daiquiri.formatter.ColorFormatter(
fmt="%(color)s%(message)s%(color_stop)s")),),
level=logging.DEBUG if args.debug else logging.INFO,
)
try:
return git_pull_request(
target_remote=args.target_remote,
target_branch=args.target_branch,
title=args.title,
message=args.message,
comment=args.comment,
rebase=not args.no_rebase,
download=args.download,
download_setup=args.download_setup,
fork=args.fork,
setup_only=args.setup_only,
from .core import communicate
from .core import execute_with_requirements
from .core import execute
from .core import safe_execute
from .core import require
from IPython import get_ipython
daiquiri.setup(
level=logging.DEBUG,
outputs=[
daiquiri.output.File(
level=logging.DEBUG,
filename='.log',
formatter=daiquiri.formatter.ColorFormatter(
fmt="%(asctime)s [%(process)d] %(color)s%(levelname)-8.8s %(name)s:"
"%(lineno)d: [JupyterRequire] %(message)s%(color_stop)s"
)),
daiquiri.output.Stream(
level=logging.WARN,
formatter=daiquiri.formatter.ColorFormatter(
fmt="%(asctime)s [%(process)d] %(color)s%(levelname)-8.8s %(name)s:"
"%(lineno)d: [JupyterRequire] %(message)s%(color_stop)s"
)
),
],
)
logger = daiquiri.getLogger()