Skip to content

Commit

Permalink
log which command is being run in spawning file adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
phiresky committed May 20, 2020
1 parent faabfa5 commit 5d97c2a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/adapters/spawning.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::*;
use encoding_rs_io::DecodeReaderBytesBuilder;
use failure::*;
use log::*;
use std::io::prelude::*;
use std::io::BufReader;
use std::process::Command;
Expand Down Expand Up @@ -117,9 +118,11 @@ where
..
} = ai;
let cmd = Command::new(self.get_exe());
let cmd = self.command(filepath_hint, cmd);
debug!("executing {:?}", cmd);
pipe_output(
line_prefix,
self.command(filepath_hint, cmd),
cmd,
&mut inp,
oup,
self.get_exe(),
Expand Down
4 changes: 2 additions & 2 deletions src/matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::iter::Iterator;

use std::rc::Rc;

#[derive(Clone)]
#[derive(Clone, Debug)]
pub enum FastMatcher {
// MimeType(Regex),
/**
Expand All @@ -23,7 +23,7 @@ pub enum FastMatcher {
// todo: maybe allow matching a directory (e.g. /var/lib/postgres)
}

#[derive(Clone)]
#[derive(Clone, Debug)]
pub enum SlowMatcher {
/// any type of fast matcher
Fast(FastMatcher),
Expand Down
4 changes: 4 additions & 0 deletions src/preproc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ pub fn rga_preproc(ai: AdaptInfo) -> Fallible<()> {
match adapter {
Some((adapter, detection_reason)) => {
let meta = adapter.metadata();
debug!(
"chose adapter '{}' because of matcher {:?}",
&meta.name, &detection_reason
);
eprintln!("adapter: {}", &meta.name);
let db_name = format!("{}.v{}", meta.name, meta.version);
if let Some(cache) = cache.as_mut() {
Expand Down

0 comments on commit 5d97c2a

Please sign in to comment.