odo icon indicating copy to clipboard operation
odo copied to clipboard

`odo dev` should have `--logs` flag

Open kadel opened this issue 3 years ago • 6 comments

--logs flag will enable automatic tailing of stderr and stdout logs from all containers and show it to stdout

kadel avatar May 05 '22 08:05 kadel

blocked on #5715

kadel avatar Jun 06 '22 12:06 kadel

odo dev without any flag prints below:

$ odo dev
  __
 /  \__     Developing using the devfile-nodejs-deploy Devfile
 \__/  \    Namespace: myproject
 /  \__/    odo version: v3.0.0-alpha3
 \__/

↪ Deploying to the cluster in developer mode
 ✓  Creating kind Pod [16ms]
 ✓  Waiting for Kubernetes resources [8s]
 ✓  Syncing files into the container [205ms]
 ✓  Building your application in container on cluster [3s]
 •  Executing the application  ...

Your application is now running on the cluster
 - Forwarding from 127.0.0.1:40001 -> 3000

Watching for changes in the current directory /home/dshah/src/devfile-nodejs-deploy
Press Ctrl+c to exit `odo dev` and delete resources from the cluster

When the user modifies some file, it goes into a loop of printing this information again.

How should odo print the logs along with the odo dev output? What I can think of is simply dumping logs after odo is done printing the line Press Ctrl+c to exit ..... However, from an UX (UI?) perspective, this might be a bit ugly, depending on whom you ask.

Can you provide example output of how odo should print the logs to stdout when the user does odo dev --logs?

dharmit avatar Jun 20 '22 11:06 dharmit

How should odo print the logs along with the odo dev output? What I can think of is simply dumping logs after odo is done printing the line Press Ctrl+c to exit ..... However, from an UX (UI?) perspective, this might be a bit ugly, depending on whom you ask.

I can't think of an approach other than this. When the user passes --logs flag, odo should first finish whatever it's doing w.r.t pushing the component to the cluster. Once it's done, it can start printing logs.

Whenever odo detects a change in code, the dev workflow is re-triggered. During this time, we should not log anything and resume only after dev workflow has completed (if it completes successfully.)

@kadel wdyt?

dharmit avatar Jun 22 '22 06:06 dharmit

I can't think of an approach other than this. When the user passes --logs flag, odo should first finish whatever it's doing w.r.t pushing the component to the cluster. Once it's done, it can start printing logs.

Whenever odo detects a change in code, the dev workflow is re-triggered. During this time, we should not log anything and resume only after dev workflow has completed (if it completes successfully.)

@kadel wdyt?

+1

kadel avatar Jun 23 '22 09:06 kadel

Blocked by #5933

cdrage avatar Aug 02 '22 13:08 cdrage

Requires https://github.com/redhat-developer/odo/issues/6058

rm3l avatar Sep 01 '22 15:09 rm3l