Function set

Summary

#include <src/easylogging++.h>

(1) void set(Level level, ConfigurationType configurationType, const std::string &value)

(2) void set(Configuration *conf)

Function overload

Synopsis

#include <src/easylogging++.h>

void set(Level level, ConfigurationType configurationType, const std::string &value)

Description

Sets value of configuration for specified level.

@detail Any existing configuration for specified level will be replaced. Also note that configuration types ConfigurationType::SubsecondPrecision and ConfigurationType::PerformanceTracking will be ignored if not set for Level::Global because these configurations are not dependant on level.

Parameters

level - Level to set configuration for (el::Level).

configurationType - Type of configuration (el::ConfigurationType)

value - A string based value. Regardless of what the data type of configuration is, it will always be string from users' point of view. This is then parsed later to be used internally.

See
Configuration::setValue(const std::string& value)
See
el::Level
See
el::ConfigurationType

Mentioned in

Source

Lines 349-355 in src/easylogging++.cc. Line 1795 in src/easylogging++.h.

void Configurations::set(Level level, ConfigurationType configurationType, const std::string& value) {
  base::threading::ScopedLock scopedLock(lock());
  unsafeSet(level, configurationType, value);  // This is not unsafe anymore as we have locked mutex
  if (level == Level::Global) {
    unsafeSetGlobally(configurationType, value, false);  // Again this is not unsafe either
  }
}

Synopsis

#include <src/easylogging++.h>

void set(Configuration *conf)

Description

Sets single configuration based on other single configuration.

See
set(Level level, ConfigurationType configurationType, const std::string& value)

Mentioned in

Source

Lines 357-362 in src/easylogging++.cc. Line 1799 in src/easylogging++.h.

void Configurations::set(Configuration* conf) {
  if (conf == nullptr) {
    return;
  }
  set(conf->level(), conf->configurationType(), conf->value());
}





Add Discussion

Log in to comment