Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease logging noise during development #869

Closed
8 tasks done
Tracked by #740
alecthomas opened this issue Feb 1, 2024 · 1 comment · Fixed by #877
Closed
8 tasks done
Tracked by #740

Decrease logging noise during development #869

alecthomas opened this issue Feb 1, 2024 · 1 comment · Fixed by #877
Labels
enhancement New feature or request epic An umbrella topic next Work that will be be picked up next

Comments

@alecthomas
Copy link
Collaborator

alecthomas commented Feb 1, 2024

Ideas:

  • Go through and adjust log levels for things so they don't log everything FTL is doing (feat: reduce logging levels #877(
  • Replace goreman with some ftl dev <> that does everything. Nice in general, but also so we get coloured logs.
  • Buffer logs and if there's an error dump the last N lines of log (feat: reduce logging levels #877)
  • Maybe make ftl deploy also leverage --exit-after-deploy?
  • Exponential backoff per module
  • Does the 5 second delay get canceled if there's a file system change?
  • Somehow (?) send error: Unary RPC failed: unavailable: dial tcp 127.0.0.1:8892: connect: connection refused: /xyz.block.ftl.v1.ControllerService/GetSchema to debug when starting up? Maybe we don't log errors on initial connection establishment before a timeout?
  • Don't log warn:controller0: Failed to increase deployment replicas: failed to claim runners for oidcauth-86ae51d623: no idle runners found matching labels {"languages":["go"]}: not found (fix: reduce controller log warnings #890)
@github-project-automation github-project-automation bot moved this to Todo in FTL Feb 1, 2024
wesbillman added a commit that referenced this issue Feb 6, 2024
Fixes #869 

Reduce log levels for `Info` and `Debug`
`Debug -> Trace`
`Info -> Debug`

Also adds a `RunBuffered` to `exec` to allow `Command`s to be run and
the output buffered to a circular buffer. The output is printed out at
the current log level if an error occurs. The result is a quiet terminal
when things go well and context output when things fail.

Some examples:
```
ftl serve --recreate --allow-origins "*"
info: Starting FTL with 1 controller(s) and 0 runner(s)
info:controller0: Web console available at: http://localhost:5173
```

```
ftl build examples/kotlin/ftl-module-api
info: Building kotlin module 'api'
info: Successfully built module 'api' in 7.26s
```

```
ftl deploy examples/go/httpingress
info: Building go module 'httpingress'
info: Successfully built module 'httpingress' in 3.99s
info: Preparing module 'httpingress' for deployment
info: Successfully created deployment httpingress-5792064876
```

```
ftl dev examples/kotlin
info: Building kotlin module 'api'
info: Successfully built module 'api' in 8.85s
info: Preparing module 'api' for deployment
info: Successfully created deployment api-5837eca0af
info: Building kotlin module 'echo'
info: Successfully built module 'echo' in 6.95s
info: Preparing module 'echo' for deployment
info: Successfully created deployment echo-31ad4e0677
info: Building kotlin module 'ad'
info: Successfully built module 'ad' in 7.63s
info: Preparing module 'ad' for deployment
info: Successfully created deployment ad-e75c5b489a
```

And some error examples:
```
ftl dev examples/kotlin/ftl-module-echo
info: Building kotlin module 'echo'
info: r
[INFO]
[INFO] --- exec:3.0.0:exec (default) @ ftl-module-echo ---
Generated module: /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/target/generated-sources/ftl/builtin/BuiltinModuleClient.kt
[INFO]
[INFO] --- build-helper:3.2.0:add-source (default) @ ftl-module-echo ---
[INFO] Source directory: /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/target/generated-sources/ftl added.
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ ftl-module-echo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/resources
[INFO]
[INFO] --- compiler:3.11.0:compile (default-compile) @ ftl-module-echo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- kotlin:1.9.0:compile (compile) @ ftl-module-echo ---
[WARNING] Source root doesn't exist: /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/java
[WARNING] Using experimental Kotlin incremental compilation
[INFO] Non-incremental compilation will be performed: NO_BUILD_HISTORY
[INFO] Kotlin compile iteration: /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt, /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/target/generated-sources/ftl/builtin/BuiltinModuleClient.kt
[INFO] Exit code: COMPILATION_ERROR
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt: (3, 12) Unresolved reference: time
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt: (4, 12) Unresolved reference: time
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt: (20, 28) Not enough information to infer type variable R
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt: (20, 33) Unresolved reference: TimeModuleClient
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt: (20, 51) Unresolved reference: time
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt: (20, 57) Unresolved reference: TimeRequest
[INFO] Compiled 2 Kotlin files using incremental compiler
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.369 s
[INFO] Finished at: 2024-02-05T11:59:18-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.9.0:compile (compile) on project ftl-module-echo: Compilation failure: Compilation failure:
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt:[3,12] Unresolved reference: time
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt:[4,12] Unresolved reference: time
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt:[20,28] Not enough information to infer type variable R
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt:[20,33] Unresolved reference: TimeModuleClient
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt:[20,51] Unresolved reference: time
[ERROR] /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo/src/main/kotlin/ftl/echo/Echo.kt:[20,57] Unresolved reference: TimeRequest
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

error: Error deploying module /Users/wesbillman/dev/ftl/examples/kotlin/ftl-module-echo. Will retry: failed to build module: exit status 1
info: Building kotlin module 'echo'
```
@github-project-automation github-project-automation bot moved this from Todo to Done in FTL Feb 6, 2024
@alecthomas alecthomas reopened this Feb 7, 2024
@github-project-automation github-project-automation bot moved this from Done to Todo in FTL Feb 7, 2024
@alecthomas alecthomas added enhancement New feature or request epic An umbrella topic labels Feb 7, 2024
@wesbillman wesbillman mentioned this issue Feb 7, 2024
@alecthomas alecthomas added the next Work that will be be picked up next label Feb 11, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Feb 12, 2024
@alecthomas alecthomas removed the triage Issue needs triaging label Feb 12, 2024
@wesbillman
Copy link
Collaborator

This is complete or has other issues created for it. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request epic An umbrella topic next Work that will be be picked up next
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants