@@ -47,24 +47,24 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
47
47
, _ignoreList(new IgnoreInstrumentationList())
48
48
{
49
49
try {
50
- auto globalNewRelicConfigurationDocument = std::make_shared< rapidxml::xml_document<xchar_t >>() ;
51
- globalNewRelicConfigurationDocument-> parse <rapidxml::parse_trim_whitespace | rapidxml::parse_normalize_whitespace>(const_cast <xchar_t *>(globalNewRelicConfiguration.c_str ()));
50
+ rapidxml::xml_document<xchar_t > globalNewRelicConfigurationDocument ;
51
+ globalNewRelicConfigurationDocument. parse <rapidxml::parse_trim_whitespace | rapidxml::parse_normalize_whitespace>(const_cast <xchar_t *>(globalNewRelicConfiguration.c_str ()));
52
52
53
- auto globalNewRelicConfigurationNode = GetConfigurationNode (globalNewRelicConfigurationDocument);
53
+ auto globalNewRelicConfigurationNode = GetConfigurationNode (globalNewRelicConfigurationDocument);
54
54
if (globalNewRelicConfigurationNode == nullptr )
55
55
{
56
56
LogError (L" Unable to locate configuration node in the global newrelic.config file." );
57
57
throw ConfigurationException ();
58
58
}
59
59
60
60
auto appliedNewRelicConfigurationNode = globalNewRelicConfigurationNode;
61
- auto localNewRelicConfigurationDocument = std::make_shared<rapidxml::xml_document<xchar_t >>();
62
61
63
62
if (localNewRelicConfiguration.second )
64
63
{
65
64
try
66
65
{
67
- localNewRelicConfigurationDocument->parse <rapidxml::parse_trim_whitespace | rapidxml::parse_normalize_whitespace>(const_cast <xchar_t *>(localNewRelicConfiguration.first .c_str ()));
66
+ rapidxml::xml_document<xchar_t > localNewRelicConfigurationDocument;
67
+ localNewRelicConfigurationDocument.parse <rapidxml::parse_trim_whitespace | rapidxml::parse_normalize_whitespace>(const_cast <xchar_t *>(localNewRelicConfiguration.first .c_str ()));
68
68
69
69
auto localNewRelicConfigurationNode = GetConfigurationNode (localNewRelicConfigurationDocument);
70
70
if (localNewRelicConfigurationNode == nullptr )
@@ -92,7 +92,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
92
92
SetLogLevel (appliedNewRelicConfigurationNode);
93
93
SetInstrumentationData (appliedNewRelicConfigurationNode);
94
94
SetApplicationPools (appliedNewRelicConfigurationNode);
95
-
95
+
96
96
} catch (const rapidxml::parse_error& exception ) {
97
97
// We log two separate error messages here because sometimes the logging macros hang when
98
98
// logging the "where" contents
@@ -196,15 +196,15 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
196
196
return _logLevel;
197
197
}
198
198
199
- bool GetConsoleLogging () const
199
+ bool GetConsoleLogging ()
200
200
{
201
201
return _consoleLogging;
202
202
}
203
- bool GetLoggingEnabled () const
203
+ bool GetLoggingEnabled ()
204
204
{
205
205
return _loggingEnabled;
206
206
}
207
- IgnoreInstrumentationListPtr GetIgnoreInstrumentationList () const
207
+ IgnoreInstrumentationListPtr GetIgnoreInstrumentationList ()
208
208
{
209
209
return _ignoreList;
210
210
}
@@ -224,9 +224,9 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
224
224
std::shared_ptr<NewRelic::Profiler::Logger::IFileDestinationSystemCalls> _systemCalls;
225
225
IgnoreInstrumentationListPtr _ignoreList;
226
226
227
- rapidxml::xml_node<xchar_t >* GetConfigurationNode (const std::shared_ptr< rapidxml::xml_document<xchar_t >> document)
227
+ rapidxml::xml_node<xchar_t >* GetConfigurationNode (const rapidxml::xml_document<xchar_t >& document)
228
228
{
229
- auto configurationNode = document-> first_node (_X (" configuration" ), 0 , false );
229
+ auto configurationNode = document. first_node (_X (" configuration" ), 0 , false );
230
230
if (configurationNode == nullptr ) {
231
231
return nullptr ;
232
232
}
@@ -294,7 +294,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
294
294
_logLevel = TryParseLogLevel (level);
295
295
}
296
296
297
- Logger::Level TryParseLogLevel (const xstring_t & logText) const
297
+ Logger::Level TryParseLogLevel (const xstring_t & logText)
298
298
{
299
299
if (Strings::AreEqualCaseInsensitive (logText, _X (" off" ))) {
300
300
return Logger::Level::LEVEL_ERROR;
@@ -423,8 +423,8 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
423
423
if (applicationConfiguration.empty ())
424
424
return ;
425
425
426
- auto document = std::make_shared< rapidxml::xml_document<xchar_t >>() ;
427
- document-> parse <rapidxml::parse_trim_whitespace | rapidxml::parse_normalize_whitespace>(const_cast <xchar_t *>(applicationConfiguration.c_str ()));
426
+ rapidxml::xml_document<xchar_t > document ;
427
+ document. parse <rapidxml::parse_trim_whitespace | rapidxml::parse_normalize_whitespace>(const_cast <xchar_t *>(applicationConfiguration.c_str ()));
428
428
auto configurationNode = GetConfigurationNode (document);
429
429
430
430
auto appSettingsNode = configurationNode->first_node (_X (" appSettings" ), 0 , false );
@@ -468,7 +468,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
468
468
static bool IsProcessInProcessList (const ProcessesPtr& processes, const xstring_t & processName)
469
469
{
470
470
// check the processes loaded from configuration
471
- for (auto & validProcessName : *processes) {
471
+ for (auto validProcessName : *processes) {
472
472
if (Strings::EndsWith (processName, validProcessName)) {
473
473
return true ;
474
474
}
@@ -498,7 +498,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration {
498
498
return isIis;
499
499
}
500
500
501
- bool ShouldInstrumentApplicationPool (const xstring_t & appPoolId) const
501
+ bool ShouldInstrumentApplicationPool (const xstring_t & appPoolId)
502
502
{
503
503
if (ApplicationPoolIsOnBlackList (appPoolId, _applicationPoolsBlackList)) {
504
504
LogInfo (_X (" This application pool (" ) + appPoolId + _X (" ) is explicitly configured to NOT be instrumented." ));
0 commit comments