mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 13:04:28 -04:00
Update QsLog to 2.1 snapshot 46b643d5bcbc
This commit is contained in:
26
third_party/QsLog/QsLogDest.cpp
vendored
26
third_party/QsLog/QsLogDest.cpp
vendored
@ -32,39 +32,37 @@
|
||||
namespace QsLogging
|
||||
{
|
||||
|
||||
Destination::~Destination()
|
||||
{
|
||||
}
|
||||
Destination::~Destination() noexcept = default;
|
||||
|
||||
//! destination factory
|
||||
DestinationPtr DestinationFactory::MakeFileDestination(const QString& filePath,
|
||||
DestinationPtrU DestinationFactory::MakeFileDestination(const QString& filePath,
|
||||
LogRotationOption rotation, const MaxSizeBytes &sizeInBytesToRotateAfter,
|
||||
const MaxOldLogCount &oldLogsToKeep)
|
||||
{
|
||||
if (EnableLogRotation == rotation) {
|
||||
QScopedPointer<SizeRotationStrategy> logRotation(new SizeRotationStrategy);
|
||||
if (LogRotationOption::EnableLogRotation == rotation) {
|
||||
std::unique_ptr<SizeRotationStrategy> logRotation(new SizeRotationStrategy);
|
||||
logRotation->setMaximumSizeInBytes(sizeInBytesToRotateAfter.size);
|
||||
logRotation->setBackupCount(oldLogsToKeep.count);
|
||||
|
||||
return DestinationPtr(new FileDestination(filePath, RotationStrategyPtr(logRotation.take())));
|
||||
return DestinationPtrU(new FileDestination(filePath, std::move(logRotation)));
|
||||
}
|
||||
|
||||
return DestinationPtr(new FileDestination(filePath, RotationStrategyPtr(new NullRotationStrategy)));
|
||||
return DestinationPtrU(new FileDestination(filePath, RotationStrategyPtrU(new NullRotationStrategy)));
|
||||
}
|
||||
|
||||
DestinationPtr DestinationFactory::MakeDebugOutputDestination()
|
||||
DestinationPtrU DestinationFactory::MakeDebugOutputDestination()
|
||||
{
|
||||
return DestinationPtr(new DebugOutputDestination);
|
||||
return DestinationPtrU(new DebugOutputDestination);
|
||||
}
|
||||
|
||||
DestinationPtr DestinationFactory::MakeFunctorDestination(QsLogging::Destination::LogFunction f)
|
||||
DestinationPtrU DestinationFactory::MakeFunctorDestination(QsLogging::Destination::LogFunction f)
|
||||
{
|
||||
return DestinationPtr(new FunctorDestination(f));
|
||||
return DestinationPtrU(new FunctorDestination(f));
|
||||
}
|
||||
|
||||
DestinationPtr DestinationFactory::MakeFunctorDestination(QObject *receiver, const char *member)
|
||||
DestinationPtrU DestinationFactory::MakeFunctorDestination(QObject *receiver, const char *member)
|
||||
{
|
||||
return DestinationPtr(new FunctorDestination(receiver, member));
|
||||
return DestinationPtrU(new FunctorDestination(receiver, member));
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
|
Reference in New Issue
Block a user