Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/workloads/cortex/onnx_serve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import sys
import os
import argparse
import builtins

from flask import Flask, request, jsonify, g
from flask_api import status
Expand All @@ -27,6 +28,13 @@
from cortex.lib.log import get_logger
from cortex.lib.exceptions import CortexException, UserRuntimeException, UserException


def cortex_print(*args, **kwargs):
logger.info(*args)


builtins.print = cortex_print

logger = get_logger()
logger.propagate = False # prevent double logging (flask modifies root logger)

Expand Down
8 changes: 8 additions & 0 deletions pkg/workloads/cortex/tf_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import os
import argparse
import time
import builtins

import tensorflow as tf
from flask import Flask, request, jsonify, g
Expand All @@ -32,6 +33,13 @@
from cortex.lib.log import get_logger
from cortex.lib.exceptions import CortexException, UserRuntimeException, UserException


def cortex_print(*args, **kwargs):
logger.info(*args)


builtins.print = cortex_print

logger = get_logger()
logger.propagate = False # prevent double logging (flask modifies root logger)

Expand Down