chg: print warnings to stderr rather than stdout

Warning messages emitted when encountering broken links/references will
now be printed to stderr as opposed to stdout.
This commit is contained in:
Nick Groenen 2021-01-04 19:22:05 +01:00
parent 6033407266
commit 4401123ea1
No known key found for this signature in database
GPG Key ID: 4F0AD019928AE098

View File

@ -446,7 +446,7 @@ impl<'a> Exporter<'a> {
let path = lookup_filename_in_vault(note_ref.file, &self.vault_contents.as_ref().unwrap()); let path = lookup_filename_in_vault(note_ref.file, &self.vault_contents.as_ref().unwrap());
if path.is_none() { if path.is_none() {
// TODO: Extract into configurable function. // TODO: Extract into configurable function.
println!( eprintln!(
"Warning: Unable to find embedded note\n\tReference: '{}'\n\tSource: '{}'\n", "Warning: Unable to find embedded note\n\tReference: '{}'\n\tSource: '{}'\n",
note_ref.file, note_ref.file,
context.current_file().display(), context.current_file().display(),
@ -506,7 +506,7 @@ impl<'a> Exporter<'a> {
lookup_filename_in_vault(reference.file, &self.vault_contents.as_ref().unwrap()); lookup_filename_in_vault(reference.file, &self.vault_contents.as_ref().unwrap());
if target_file.is_none() { if target_file.is_none() {
// TODO: Extract into configurable function. // TODO: Extract into configurable function.
println!( eprintln!(
"Warning: Unable to find referenced note\n\tReference: '{}'\n\tSource: '{}'\n", "Warning: Unable to find referenced note\n\tReference: '{}'\n\tSource: '{}'\n",
reference.file, reference.file,
context.current_file().display(), context.current_file().display(),