Comments (3)
Good points. I'd be up for a redesign of the templ output.
I like to see the feedback that "stuff is happening", especially in watch mode, but it is a little noisy. It outputs so much that it obscures any application logging output that's happening at the same time.
I'd really like to see something like a bubbletea style interface for interactive sessions (https://github.com/charmbracelet/bubbletea) where you can see a short summary of whether templ is working, and maybe show/hide your own application logging too. In the interactive mode, it would probably show something like the last time it ran (5 seconds ago etc.), how long each run is estimated to take, when the app was last restarted, a progress bar if it's running a generate, a tail of the underlying app logs, and maybe the last few HTTP request/response operations from the proxy.
Along with that (as the default), a --plain
flag would be useful (probably more your style?), where there's minimal output with no bubbletea style interface.
So, support two modes, interactive, and a plain version for CI/CD and integration into other workflows.
from templ.
I've introduced a new structured logger, with a custom colourised handler in #470 while I was rewriting everything.
I thought that a fancy TUI was overkill once the output was tidied up. By default, it logs at Info
level, so the default output is much simpler, just providing a summary.
$ templ generate
(✓) Complete [ updates=54 duration=87.295806ms ]
It's now under a verbose flag. You can set -v
for debug mode, or set the level to "warn", "error" etc.. with the -log-level
flag if you want no output at all unless there's errors.
However, I've kept the logs on stdout, since go's slog handler only has the choice of one and the logs are the program output.
from templ.
Update on this one. Decided to log to stderr
, since it affects Bazel and other users to log to stdout
.
from templ.
Related Issues (20)
- bug: ambiguous child/string expression grammar HOT 4
- bug: go to definition causes error in Neovim v0.10.x HOT 11
- LSP - gopls command error HOT 3
- bug: ComponentScript rendered even when 'if condition' fails HOT 1
- GoToDef .Templ templ() instead of .go func () HOT 2
- bug(lsp): diagnostics error on Windows due to URI encoding HOT 1
- If you write the class attribute 2 times, the second one is silently discarded HOT 1
- bug: discrepancy between buffers in `runtime.go` and `runtime/bufferpool.go` HOT 3
- `templ generate` is loading my layout into styles.css HOT 5
- documentation: templ.SafeURL is not working as described HOT 8
- Setting children from go code HOT 2
- Neovim/Template goto definition returns error: index out of range HOT 9
- proposal: render individual template fragments
- Taking too much memory with (relatively) larger files HOT 5
- Switch fallthrough not supported
- Suggestion when convert golang template to a-h/templ HOT 4
- Handle Generics for templ ('func') definition HOT 1
- Parser chokes on "<" in if statements HOT 3
- Support else ifs in conditional attributes HOT 4
- Templ removes significant white space inside <pre> tags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templ.