| 1 | // |
|---|---|
| 2 | // LoggingSubsystem.cpp |
| 3 | // |
| 4 | // Library: Util |
| 5 | // Package: Application |
| 6 | // Module: LoggingSubsystem |
| 7 | // |
| 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
| 9 | // and Contributors. |
| 10 | // |
| 11 | // SPDX-License-Identifier: BSL-1.0 |
| 12 | // |
| 13 | |
| 14 | |
| 15 | #include "Poco/Util/LoggingSubsystem.h" |
| 16 | #include "Poco/Util/LoggingConfigurator.h" |
| 17 | #include "Poco/Util/Application.h" |
| 18 | #include "Poco/Logger.h" |
| 19 | |
| 20 | |
| 21 | using Poco::Logger; |
| 22 | |
| 23 | |
| 24 | namespace Poco { |
| 25 | namespace Util { |
| 26 | |
| 27 | |
| 28 | LoggingSubsystem::LoggingSubsystem() |
| 29 | { |
| 30 | } |
| 31 | |
| 32 | |
| 33 | LoggingSubsystem::~LoggingSubsystem() |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | |
| 38 | const char* LoggingSubsystem::name() const |
| 39 | { |
| 40 | return "Logging Subsystem"; |
| 41 | } |
| 42 | |
| 43 | |
| 44 | void LoggingSubsystem::initialize(Application& app) |
| 45 | { |
| 46 | LoggingConfigurator configurator; |
| 47 | configurator.configure(app.configPtr()); |
| 48 | std::string logger = app.config().getString("application.logger", "Application"); |
| 49 | app.setLogger(Logger::get(logger)); |
| 50 | } |
| 51 | |
| 52 | |
| 53 | void LoggingSubsystem::uninitialize() |
| 54 | { |
| 55 | } |
| 56 | |
| 57 | |
| 58 | } } // namespace Poco::Util |
| 59 |