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

Print the current sync time along with the watcher's output #431

Merged
merged 1 commit into from
Jul 6, 2017

Conversation

tiagopog
Copy link
Contributor

@tiagopog tiagopog commented Jul 2, 2017

Use case: when I'm not sure whether the last change synced properly I usually check the docker-sync log in order to see what actually happened, but it turns out that having no time reference doesn't help that much:

$ docker-sync logs -f
...
     success  Starting to watch /Users/tiagopog/Dev/ruby/my_awesome_project - Press CTRL-C to stop
Sync web-sync            ok  Synced /Users/tiagopog/Dev/ruby/my_awesome_project
Sync web-sync            ok  Synced /Users/tiagopog/Dev/ruby/my_awesome_project
Sync web-sync            ok  Synced /Users/tiagopog/Dev/ruby/my_awesome_project

Now prepending the sync time in the output string makes really easier to figure out whether something was synced:

$ docker-sync logs -f
...
     success  Starting to watch /Users/tiagopog/Dev/ruby/my_awesome_project - Press CTRL-C to stop
[2017-07-02 03:44:04 -0300] Sync web-sync            ok  Synced /Users/tiagopog/Dev/ruby/my_awesome_project
[2017-07-02 03:45:15 -0300] Sync web-sync            ok  Synced /Users/tiagopog/Dev/ruby/my_awesome_project
[2017-07-02 03:47:21 -0300] Sync web-sync            ok  Synced /Users/tiagopog/Dev/ruby/my_awesome_project

I hope this is helpful and thanks for this awesome project.

@EugenMayer
Copy link
Owner

Makes a lot of sense, iam on Holliday and If nobody reviewed it until then I am happy to do so an merge it!

Thank you for the contribution!

@tiagopog
Copy link
Contributor Author

tiagopog commented Jul 5, 2017

Nice to know, @EugenMayer. Shall it be merged then? I've been using the fork of docker-sync for the past 3 days and it's being quite useful on the logging/debugging side.

@EugenMayer
Copy link
Owner

I need to review this when I am back at home, generally speaking, it will be merged for sure

@EugenMayer
Copy link
Owner

Thank you for the patch, looks good. For the next time, please do not combine refactoring with an actual feature ( forkexec -> fork_exec ..threadexec ) since this makes things a lot more complicated. Refactoring must be done in a very sensible time slot - i did not block it this time since i think its ok for now, but lets not do this again.

Thank you for this great contribution!

@EugenMayer EugenMayer merged commit e7d8e56 into EugenMayer:master Jul 6, 2017
@tiagopog
Copy link
Contributor Author

tiagopog commented Jul 7, 2017

You're right, my bad. Anyway, thanks for warning. Cheers!

@EugenMayer EugenMayer added this to the 0.5.0 milestone Oct 4, 2017
@EugenMayer EugenMayer mentioned this pull request Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants