diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-06-18 15:40:41 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-06-18 15:54:40 +0200 |
commit | 83be2191b4f3eb8906160d61f61cae48532ee651 (patch) | |
tree | edc4298b13dba0bdd501954489549725218c2373 /libqpdf/QPDFLogger.cc | |
parent | 641e92c6a7662a01f488947c3791f3b77e85517f (diff) | |
download | qpdf-83be2191b4f3eb8906160d61f61cae48532ee651.tar.zst |
Use "save" logger when saving data to standard output
This includes the output PDF, streams from --show-object and
attachments from --save-attachment. This also enables --verbose and
--progress to work with saving to stdout.
Diffstat (limited to 'libqpdf/QPDFLogger.cc')
-rw-r--r-- | libqpdf/QPDFLogger.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libqpdf/QPDFLogger.cc b/libqpdf/QPDFLogger.cc index 859d6dcd..3b25c050 100644 --- a/libqpdf/QPDFLogger.cc +++ b/libqpdf/QPDFLogger.cc @@ -2,6 +2,7 @@ #include <qpdf/Pl_Discard.hh> #include <qpdf/Pl_OStream.hh> +#include <qpdf/QUtil.hh> #include <iostream> #include <stdexcept> @@ -182,6 +183,9 @@ QPDFLogger::setError(std::shared_ptr<Pipeline> p) void QPDFLogger::setSave(std::shared_ptr<Pipeline> p) { + if (this->m->p_save == p) { + return; + } if (p == this->m->p_stdout) { auto pt = dynamic_cast<Pl_Track*>(p.get()); if (pt->getUsed()) { @@ -192,6 +196,7 @@ QPDFLogger::setSave(std::shared_ptr<Pipeline> p) if (this->m->p_info == this->m->p_stdout) { this->m->p_info = this->m->p_stderr; } + QUtil::binary_stdout(); } this->m->p_save = p; } |