GithubHelp home page GithubHelp logo

Comments (5)

wez avatar wez commented on April 25, 2024

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.

mganjoo avatar mganjoo commented on April 25, 2024

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.

wez avatar wez commented on April 25, 2024

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.

mganjoo avatar mganjoo commented on April 25, 2024

That makes sense. The log wrapper suggestion seems like it would serve my purposes. Thanks!

from watchman.

wez avatar wez commented on April 25, 2024

I'll close this out as it doesn't require any code change in watchman itself; Thanks!

from watchman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.