| 564 | } |
| 565 | |
| 566 | void Logger::configure(const Configurations& configurations) { |
| 567 | m_isConfigured = false; // we set it to false in case if we fail |
| 568 | initUnflushedCount(); |
| 569 | if (m_typedConfigurations != nullptr) { |
| 570 | Configurations* c = const_cast<Configurations*>(m_typedConfigurations->configurations()); |
| 571 | if (c->hasConfiguration(Level::Global, ConfigurationType::Filename)) { |
| 572 | // This check is definitely needed for cases like ELPP_NO_DEFAULT_LOG_FILE |
| 573 | flush(); |
| 574 | } |
| 575 | } |
| 576 | base::threading::ScopedLock scopedLock(lock()); |
| 577 | if (m_configurations != configurations) { |
| 578 | m_configurations.setFromBase(const_cast<Configurations*>(&configurations)); |
| 579 | } |
| 580 | base::utils::safeDelete(m_typedConfigurations); |
| 581 | m_typedConfigurations = new base::TypedConfigurations(&m_configurations, m_logStreamsReference); |
| 582 | resolveLoggerFormatSpec(); |
| 583 | m_isConfigured = true; |
| 584 | } |
| 585 | |
| 586 | void Logger::reconfigure(void) { |
| 587 | ELPP_INTERNAL_INFO(1, "Reconfiguring logger [" << m_id << "]"); |
no test coverage detected