@@ -185,7 +185,8 @@ def f(ctx, **kwargs):
185185 _validate_interactive_quiet_params (ctx )
186186
187187 show_progress : bool = ctx .obj ["show_progress" ]
188- with enable_output (show_progress ):
188+ show_timestamps : bool = ctx .obj ["show_timestamps" ]
189+ with enable_output (show_progress , show_timestamps = show_timestamps ):
189190 with run_app (
190191 app ,
191192 detach = ctx .obj ["detach" ],
@@ -314,7 +315,8 @@ def f(ctx, *args, **kwargs):
314315 _validate_interactive_quiet_params (ctx )
315316
316317 show_progress : bool = ctx .obj ["show_progress" ]
317- with enable_output (show_progress ):
318+ show_timestamps : bool = ctx .obj ["show_timestamps" ]
319+ with enable_output (show_progress , show_timestamps = show_timestamps ):
318320 with run_app (
319321 app ,
320322 detach = ctx .obj ["detach" ],
@@ -404,8 +406,9 @@ def get_command(self, ctx, func_ref):
404406@click .option ("-i" , "--interactive" , is_flag = True , help = "Run the app in interactive mode." )
405407@click .option ("-e" , "--env" , help = ENV_OPTION_HELP , default = None )
406408@click .option ("-m" , is_flag = True , help = "Interpret argument as a Python module path instead of a file/script path" )
409+ @click .option ("--timestamps" , is_flag = True , help = "Show timestamps for each log line." )
407410@click .pass_context
408- def run (ctx , write_result , detach , quiet , interactive , env , m ):
411+ def run (ctx , write_result , detach , quiet , interactive , env , m , timestamps ):
409412 """Run a Modal function or local entrypoint.
410413
411414 `FUNC_REF` should be of the format `{file or module}::{function name}`.
@@ -442,6 +445,7 @@ def run(ctx, write_result, detach, quiet, interactive, env, m):
442445 ctx .obj ["detach" ] = detach # if subcommand would be a click command...
443446 ctx .obj ["show_progress" ] = False if quiet else True
444447 ctx .obj ["interactive" ] = interactive
448+ ctx .obj ["show_timestamps" ] = timestamps
445449
446450
447451def deploy (
@@ -453,6 +457,7 @@ def deploy(
453457 use_module_mode : bool = typer .Option (
454458 False , "-m" , help = "Interpret argument as a Python module path instead of a file/script path"
455459 ),
460+ timestamps : bool = typer .Option (False , "--timestamps" , help = "Show timestamps for each log line." ),
456461):
457462 """Deploy a Modal application.
458463
@@ -477,11 +482,11 @@ def deploy(
477482 "modal deploy ... --name=some-name"
478483 )
479484
480- with enable_output ():
485+ with enable_output (show_timestamps = timestamps ):
481486 res = deploy_app (app , name = name , environment_name = env or "" , tag = tag )
482487
483488 if stream_logs :
484- stream_app_logs (app_id = res .app_id , app_logs_url = res .app_logs_url )
489+ stream_app_logs (app_id = res .app_id , app_logs_url = res .app_logs_url , show_timestamps = timestamps )
485490
486491
487492def serve (
@@ -491,6 +496,7 @@ def serve(
491496 use_module_mode : bool = typer .Option (
492497 False , "-m" , help = "Interpret argument as a Python module path instead of a file/script path"
493498 ),
499+ timestamps : bool = typer .Option (False , "--timestamps" , help = "Show timestamps for each log line." ),
494500):
495501 """Run a web endpoint(s) associated with a Modal app and hot-reload code.
496502
@@ -512,7 +518,7 @@ def serve(
512518 if app .description is None :
513519 app .set_description (_get_clean_app_description (app_ref ))
514520
515- with enable_output ():
521+ with enable_output (show_timestamps = timestamps ):
516522 with serve_app (app , import_ref , environment_name = env ):
517523 if timeout is None :
518524 timeout = config ["serve_timeout" ]
0 commit comments