Ripple verbosity flags through the server

This commit is contained in:
Lucien Greathouse
2017-12-01 00:17:29 -08:00
parent 7f3aaf4680
commit 63b21b90ff
3 changed files with 22 additions and 4 deletions

View File

@@ -6,17 +6,20 @@ use notify::{DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher};
use vfs::Vfs;
use pathext::path_to_route;
use core::Config;
pub struct VfsWatcher {
vfs: Arc<Mutex<Vfs>>,
watchers: Vec<RecommendedWatcher>,
config: Config,
}
impl VfsWatcher {
pub fn new(vfs: Arc<Mutex<Vfs>>) -> VfsWatcher {
pub fn new(config: Config, vfs: Arc<Mutex<Vfs>>) -> VfsWatcher {
VfsWatcher {
vfs,
watchers: Vec::new(),
config,
}
}
@@ -40,6 +43,7 @@ impl VfsWatcher {
{
let vfs = self.vfs.clone();
let config = self.config.clone();
thread::spawn(move || {
loop {
@@ -47,6 +51,10 @@ impl VfsWatcher {
let mut vfs = vfs.lock().unwrap();
let current_time = vfs.current_time();
if config.verbose {
println!("FS event {:?}", event);
}
match event {
DebouncedEvent::Write(ref change_path) |
DebouncedEvent::Create(ref change_path) |