Comments (5)
The log is there primarily to figure out what is broken, and I'd rather avoid stripping for two reasons:
- it will drive up the cost of logging
- it can mask potential problems by obscuring what was actually being set.
Tailing the log file should be a rare event; is there something that is causing you to do this frequently?
from watchman.
So my use case is to scp a jar file to a server every time it's successfully built. I want to see whether that is happening correctly, and as a quick solution, I simply tail the watchman log (while scp -v is set, so that I can see what the command is up to). I guess that's not the idiomatic way to do things, and that I should write a command that handles its own logging instead?
from watchman.
One of the things that people find awkward about triggers is that they are headless and continue running even when your terminal session is over. This is a feature but is a bit different from most of the other watchers out there.
One of the things on my mental TODO (although I could have sworn I had it transcribed in an issue here) is to have a session-oriented trigger mode, where you would do something like:
$ watchman fg-trigger <pattern> -- <command>
and that process would subscribe to the watchman service and spawn in your terminal session whenever matching files are changed. It could then log that it was running. Pressing CTRL-C would stop it from triggering, just like a regular unix command.
Since we don't have this today, another suggestion for you is to write a little wrapper script around the log subscriber command:
$ watchman --server-encoding=json --persistent log-level error | grep scp
or do something a bit more fancy to munge and format the json records as you prefer. You can play with the log level to adjust verbosity.
from watchman.
That makes sense. The log wrapper suggestion seems like it would serve my purposes. Thanks!
from watchman.
I'll close this out as it doesn't require any code change in watchman itself; Thanks!
from watchman.
Related Issues (20)
- watchman on riscv
- why watchman does not support query base on time frame and sorting ability?
- Impossible to install on Amazonlinux HOT 2
- Folly related build issue for ARM Ubuntu 18.04.5 LTS
- Missing RPMs in Release v2023.04.24.00
- WatchMan Error on Docker. Watchman-make is not accessible even after installation.
- "Settle" behavior blocks entire file tree during long running zip operation
- Unable to compile with fmt 10.0.0
- Unable to talk to your watchman on /opt/homebrew/var/run/watchman/[user]-state/sock! HOT 8
- serde_bser: Apache-2.0 license file missing from git repo and published crates
- No Mac OS X binary
- Watchman ignores platform-specific path separators in `dirname` expressions
- Watchman root is set to /Users/<username> despite being run from a different directory HOT 1
- Ubuntu packags missing since May HOT 3
- "I don't know how to install any packages on this system linux-mint-21.2"
- Watchman warns on custom_config example line
- Installation guide HOT 2
- Question - `hint_num_files_per_dir` recursive or not?
- Watchman service is timing out waiting for a synchronization cookie file to be observed by the watcher within 20000 milliseconds HOT 3
- Deploy on winget
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 watchman.