mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-24 12:24:56 +00:00
log which command is being run in spawning file adapters
This commit is contained in:
parent
faabfa5a42
commit
5d97c2ad5f
@ -1,6 +1,7 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use encoding_rs_io::DecodeReaderBytesBuilder;
|
use encoding_rs_io::DecodeReaderBytesBuilder;
|
||||||
use failure::*;
|
use failure::*;
|
||||||
|
use log::*;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
@ -117,9 +118,11 @@ where
|
|||||||
..
|
..
|
||||||
} = ai;
|
} = ai;
|
||||||
let cmd = Command::new(self.get_exe());
|
let cmd = Command::new(self.get_exe());
|
||||||
|
let cmd = self.command(filepath_hint, cmd);
|
||||||
|
debug!("executing {:?}", cmd);
|
||||||
pipe_output(
|
pipe_output(
|
||||||
line_prefix,
|
line_prefix,
|
||||||
self.command(filepath_hint, cmd),
|
cmd,
|
||||||
&mut inp,
|
&mut inp,
|
||||||
oup,
|
oup,
|
||||||
self.get_exe(),
|
self.get_exe(),
|
||||||
|
@ -11,7 +11,7 @@ use std::iter::Iterator;
|
|||||||
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum FastMatcher {
|
pub enum FastMatcher {
|
||||||
// MimeType(Regex),
|
// MimeType(Regex),
|
||||||
/**
|
/**
|
||||||
@ -23,7 +23,7 @@ pub enum FastMatcher {
|
|||||||
// todo: maybe allow matching a directory (e.g. /var/lib/postgres)
|
// todo: maybe allow matching a directory (e.g. /var/lib/postgres)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum SlowMatcher {
|
pub enum SlowMatcher {
|
||||||
/// any type of fast matcher
|
/// any type of fast matcher
|
||||||
Fast(FastMatcher),
|
Fast(FastMatcher),
|
||||||
|
@ -65,6 +65,10 @@ pub fn rga_preproc(ai: AdaptInfo) -> Fallible<()> {
|
|||||||
match adapter {
|
match adapter {
|
||||||
Some((adapter, detection_reason)) => {
|
Some((adapter, detection_reason)) => {
|
||||||
let meta = adapter.metadata();
|
let meta = adapter.metadata();
|
||||||
|
debug!(
|
||||||
|
"chose adapter '{}' because of matcher {:?}",
|
||||||
|
&meta.name, &detection_reason
|
||||||
|
);
|
||||||
eprintln!("adapter: {}", &meta.name);
|
eprintln!("adapter: {}", &meta.name);
|
||||||
let db_name = format!("{}.v{}", meta.name, meta.version);
|
let db_name = format!("{}.v{}", meta.name, meta.version);
|
||||||
if let Some(cache) = cache.as_mut() {
|
if let Some(cache) = cache.as_mut() {
|
||||||
|
Loading…
Reference in New Issue
Block a user