Skip to content
Closed
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
9 changes: 6 additions & 3 deletions metaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def echo_dev_null(*args, **kwargs):


def echo_always(line, **kwargs):
kwargs.setdefault("color", True)
if kwargs.pop("wrap", False):
import textwrap

Expand Down Expand Up @@ -113,10 +114,12 @@ def logger(body="", system_msg=False, head="", bad=False, timestamp=True, nl=Tru
else:
dt = timestamp
tstamp = dt.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
click.secho(tstamp + " ", fg=LOGGER_TIMESTAMP, nl=False)
click.secho(tstamp + " ", fg=LOGGER_TIMESTAMP, nl=False, color=True)
if head:
click.secho(head, fg=LOGGER_COLOR, nl=False)
click.secho(body, bold=system_msg, fg=LOGGER_BAD_COLOR if bad else None, nl=nl)
click.secho(head, fg=LOGGER_COLOR, nl=False, color=True)
click.secho(
body, bold=system_msg, fg=LOGGER_BAD_COLOR if bad else None, nl=nl, color=True
)


@click.group(
Expand Down
5 changes: 4 additions & 1 deletion metaflow/cmd/configure_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ def azure(ctx, profile):
" or a self-managed Kubernetes cluster on Azure VMs."
+ " If/when your Kubernetes cluster is ready for use,"
" please run 'metaflow configure kubernetes'.",
color=True,
)


Expand Down Expand Up @@ -854,6 +855,7 @@ def gcp(ctx, profile):
" or a self-managed Kubernetes cluster on Google Compute Engine VMs."
+ " If/when your Kubernetes cluster is ready for use,"
" please run 'metaflow configure kubernetes'.",
color=True,
)


Expand Down Expand Up @@ -939,7 +941,8 @@ def kubernetes(ctx, profile):
if existing_env.get("METAFLOW_DEFAULT_DATASTORE") == "local":
click.echo(
"\nCannot run Kubernetes with local datastore. Please run"
" 'metaflow configure aws' or 'metaflow configure azure'."
" 'metaflow configure aws' or 'metaflow configure azure'.",
color=True,
)
click.Abort()

Expand Down
1 change: 1 addition & 0 deletions metaflow/cmd/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ def echo_dev_null(*args, **kwargs):


def echo_always(line, **kwargs):
kwargs.setdefault("color", True)
click.secho(line, **kwargs)
5 changes: 4 additions & 1 deletion metaflow/plugins/logs_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def show(
if ds_list:

def echo_unicode(line, **kwargs):
kwargs.setdefault("color", True)
click.secho(line.decode("UTF-8", errors="replace"), **kwargs)

# old style logs are non mflog-style logs
Expand All @@ -196,7 +197,9 @@ def echo_unicode(line, **kwargs):
if timestamps:
ts = mflog.utc_to_local(line.utc_tstamp)
tstamp = ts.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
click.secho(tstamp + " ", fg=LOGGER_TIMESTAMP, nl=False)
click.secho(
tstamp + " ", fg=LOGGER_TIMESTAMP, nl=False, color=True
)
echo_unicode(line.msg)
maybe_old_style = False
elif maybe_old_style:
Expand Down
Loading