diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDF.cc | 2 | ||||
-rw-r--r-- | libqpdf/QPDFJob.cc | 2 | ||||
-rw-r--r-- | libqpdf/QPDFLogger.cc | 8 |
3 files changed, 9 insertions, 3 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 454c05ee..8c5e8e13 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -362,7 +362,7 @@ QPDF::setLogger(std::shared_ptr<QPDFLogger> l) void QPDF::setOutputStreams(std::ostream* out, std::ostream* err) { - setLogger(std::make_shared<QPDFLogger>()); + setLogger(QPDFLogger::create()); this->m->log->setOutputStreams(out, err); } diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index df93b859..384af854 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -460,7 +460,7 @@ QPDFJob::setLogger(std::shared_ptr<QPDFLogger> l) void QPDFJob::setOutputStreams(std::ostream* out, std::ostream* err) { - setLogger(std::make_shared<QPDFLogger>()); + setLogger(QPDFLogger::create()); this->m->log->setOutputStreams(out, err); } diff --git a/libqpdf/QPDFLogger.cc b/libqpdf/QPDFLogger.cc index 78cb2a32..7fe21c97 100644 --- a/libqpdf/QPDFLogger.cc +++ b/libqpdf/QPDFLogger.cc @@ -65,9 +65,15 @@ QPDFLogger::QPDFLogger() : } std::shared_ptr<QPDFLogger> +QPDFLogger::create() +{ + return std::shared_ptr<QPDFLogger>(new QPDFLogger); +} + +std::shared_ptr<QPDFLogger> QPDFLogger::defaultLogger() { - static auto l = std::make_shared<QPDFLogger>(); + static auto l = create(); return l; } |