Skip to content

Commit e31d8d4

Browse files
Nr 318119 auto collect stdout & stderr logs (#320)
* NR-318119 adding the ability to collect the logs sent to stdout and stderr * NR-318119 added a way to extract type of OSLog and fixed timestamp format * Removed unneeded test * NR-318119 Renamed the flag to include stderr and changed the log divider to \n\n * Trying to get more accurate timestamps when one's not there * Changed the log collector to use a pipe and added a unit test * Restoring the logging sooner in the test to hopefully see failed test logs * Trying to fix a test that only fails on github * trying to fix test run on github * It looks like github unit tests don't have oslog debug enabled * Looks like this test doesn't work on github for watchOS, will need to look further into it * Unit test changes * Restoring the first delay in the test * Trying to make the test less flakey * Using sleep instead of the wait * Adjusting the sleep value * We need default priority or the collected logs don't maintain perfect accuracy * NRLogger: Fix to honor remote log level and local log level correctly. * Revert "NRLogger: Fix to honor remote log level and local log level correctly." This reverts commit 28790a5. * Changing the name and default status of the feature flag, only redirect if remote logging is enabled * Forgot to change flag in unit tests * Added a stress test WIP, created the pipes one at a time so we can close them if needed * Removed the feature flag and only capture logs when the debugger isn't attached * Updating the Xcode version used in main.yml * trying to update to macos-14 in main.yml * trying xcode 15.4 * Changed the requiredAttributes to work with the auto-collected logs better * Added back the feature flag after discussion * Update Agent/Utilities/NRLogger.m Co-authored-by: Chris Dillard <[email protected]> --------- Co-authored-by: Chris Dillard <[email protected]> Co-authored-by: Chris Dillard <[email protected]>
1 parent 2fb2fd6 commit e31d8d4

File tree

17 files changed

+556
-27
lines changed

17 files changed

+556
-27
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
name : TestIOS
1717
# runs-on: will be set to macos-latest when running on actual GHA.
1818
# *** runs-on: ubuntu-latest is used when running via act on mac os. ***
19-
runs-on: macos-13
19+
runs-on: macos-14
2020
steps:
2121
- uses: actions/checkout@master
2222
with:
2323
submodules: true
2424

2525
- uses: maxim-lobanov/setup-xcode@v1
2626
with:
27-
xcode-version: '14.3'
27+
xcode-version: '15.4'
2828

2929
- name: Install lcov
3030
run: |
@@ -52,7 +52,7 @@ jobs:
5252

5353
- uses: maxim-lobanov/setup-xcode@v1
5454
with:
55-
xcode-version: '14.3'
55+
xcode-version: '15.4'
5656

5757
- name: Install lcov
5858
run: brew install lcov
@@ -78,7 +78,7 @@ jobs:
7878

7979
- uses: maxim-lobanov/setup-xcode@v1
8080
with:
81-
xcode-version: '14.3'
81+
xcode-version: '15.4'
8282

8383
- name: Install lcov
8484
run: brew install lcov
@@ -96,7 +96,7 @@ jobs:
9696
name: DeployS3
9797
# runs-on: will be set to macos-latest when running on actual GHA.
9898
# *** runs-on: ubuntu-latest is used when running via act on mac os. ***
99-
runs-on: macos-13
99+
runs-on: macos-14
100100
needs: [testIOS, testTVOS, testWatchOS]
101101
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main'
102102
outputs:
@@ -108,7 +108,7 @@ jobs:
108108

109109
- uses: maxim-lobanov/setup-xcode@v1
110110
with:
111-
xcode-version: '14.3'
111+
xcode-version: '15.4'
112112

113113
- name: Install the Apple certificate and provisioning profile
114114
env:

Agent.xcodeproj/project.pbxproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,12 +1497,16 @@
14971497
F858F3602AE04B0C00CF9EB5 /* NRMAURLSessionHeaderTrackingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F858F35F2AE04B0C00CF9EB5 /* NRMAURLSessionHeaderTrackingTests.m */; };
14981498
F858F3612AE04B0C00CF9EB5 /* NRMAURLSessionHeaderTrackingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F858F35F2AE04B0C00CF9EB5 /* NRMAURLSessionHeaderTrackingTests.m */; };
14991499
F86741072BD30F3F00DAA1A2 /* NRMAExceptionDataCollectionWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 02FF48D024DC622400115469 /* NRMAExceptionDataCollectionWrapper.m */; };
1500+
F8678AAE2CDBC62B008FD2A2 /* NRAutoCollectLogStressTest.m in Sources */ = {isa = PBXBuildFile; fileRef = F8678AAC2CDBC62B008FD2A2 /* NRAutoCollectLogStressTest.m */; };
15001501
F8728E412ACC9D5A0056F641 /* NRMANetworkMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = F8728E402ACC9D5A0056F641 /* NRMANetworkMonitor.m */; };
15011502
F8728E422ACC9D5A0056F641 /* NRMANetworkMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = F8728E402ACC9D5A0056F641 /* NRMANetworkMonitor.m */; };
15021503
F87954D529E89D5F00319FCD /* NRMAWKWebViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0209ABB324E704A600E45C90 /* NRMAWKWebViewTests.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
15031504
F88C2CF72A2FA7AC00373EFE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F88C2CE32A2FA7AC00373EFE /* PrivacyInfo.xcprivacy */; };
15041505
F89167372BC9D1270085BCFC /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F88C2CE32A2FA7AC00373EFE /* PrivacyInfo.xcprivacy */; };
15051506
F89167442BCD8EA30085BCFC /* NRViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = F824A43029AEAD63000886A6 /* NRViewModifier.swift */; };
1507+
F891A6BE2CB6F5C1007675F4 /* NRAutoLogCollector.m in Sources */ = {isa = PBXBuildFile; fileRef = F891A6BD2CB6F5C1007675F4 /* NRAutoLogCollector.m */; };
1508+
F891A6BF2CB6F5C1007675F4 /* NRAutoLogCollector.m in Sources */ = {isa = PBXBuildFile; fileRef = F891A6BD2CB6F5C1007675F4 /* NRAutoLogCollector.m */; };
1509+
F891A6C02CB6F5C1007675F4 /* NRAutoLogCollector.m in Sources */ = {isa = PBXBuildFile; fileRef = F891A6BD2CB6F5C1007675F4 /* NRAutoLogCollector.m */; };
15061510
F8A455482AFBE31E0057B1E0 /* NRMAURLSessionHeaderTrackingTestsOldEventSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = F8A455472AFBE31E0057B1E0 /* NRMAURLSessionHeaderTrackingTestsOldEventSystem.m */; };
15071511
F8A455492AFBE31E0057B1E0 /* NRMAURLSessionHeaderTrackingTestsOldEventSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = F8A455472AFBE31E0057B1E0 /* NRMAURLSessionHeaderTrackingTestsOldEventSystem.m */; };
15081512
F8AC3E932938FD6C002B4AA8 /* NRMAFakeDataHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = F8AC3E922938FD6C002B4AA8 /* NRMAFakeDataHelper.m */; };
@@ -2465,10 +2469,13 @@
24652469
F848CDBF2AA133EA0082052F /* NRMAInteractionEvent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NRMAInteractionEvent.m; sourceTree = "<group>"; };
24662470
F848CDD52AA133FB0082052F /* NRMAInteractionEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NRMAInteractionEvent.h; sourceTree = "<group>"; };
24672471
F858F35F2AE04B0C00CF9EB5 /* NRMAURLSessionHeaderTrackingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NRMAURLSessionHeaderTrackingTests.m; sourceTree = "<group>"; };
2472+
F8678AAC2CDBC62B008FD2A2 /* NRAutoCollectLogStressTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NRAutoCollectLogStressTest.m; sourceTree = "<group>"; };
24682473
F8728E402ACC9D5A0056F641 /* NRMANetworkMonitor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NRMANetworkMonitor.m; sourceTree = "<group>"; };
24692474
F8728E562ACC9F840056F641 /* NRMANetworkMonitor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NRMANetworkMonitor.h; sourceTree = "<group>"; };
24702475
F88C2CE32A2FA7AC00373EFE /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
24712476
F89167382BC9D1540085BCFC /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "Platforms/WatchOS.platform/Developer/SDKs/WatchOS10.2.sdk/usr/lib/libc++.tbd"; sourceTree = DEVELOPER_DIR; };
2477+
F891A6BD2CB6F5C1007675F4 /* NRAutoLogCollector.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NRAutoLogCollector.m; sourceTree = "<group>"; };
2478+
F891A6D42CB6F5D8007675F4 /* NRAutoLogCollector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NRAutoLogCollector.h; sourceTree = "<group>"; };
24722479
F8A455472AFBE31E0057B1E0 /* NRMAURLSessionHeaderTrackingTestsOldEventSystem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NRMAURLSessionHeaderTrackingTestsOldEventSystem.m; sourceTree = "<group>"; };
24732480
F8AC3E922938FD6C002B4AA8 /* NRMAFakeDataHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NRMAFakeDataHelper.m; sourceTree = "<group>"; };
24742481
F8AC3EA72938FDDB002B4AA8 /* NRMAFakeDataHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NRMAFakeDataHelper.h; sourceTree = "<group>"; };
@@ -3006,6 +3013,7 @@
30063013
025658AC24EB2AAC00FE3125 /* Info.plist */,
30073014
025658D624EB322F00FE3125 /* NRMAStressTestHelper.h */,
30083015
025658D724EB322F00FE3125 /* NRMAStressTestHelper.m */,
3016+
F8678AAD2CDBC62B008FD2A2 /* Logging Stress Tests */,
30093017
025658C524EB2F3300FE3125 /* Measurement Engine Stress Tests */,
30103018
025658C224EB2EF300FE3125 /* Harvester Stress Tests */,
30113019
025658BD24EB2ED900FE3125 /* Analytics Stress Tests */,
@@ -3641,6 +3649,8 @@
36413649
02FF4A8924DC652D00115469 /* NewRelicInternalUtils.h */,
36423650
02FF4A9024DC652D00115469 /* NewRelicInternalUtils.m */,
36433651
02FF4A7E24DC652B00115469 /* NRLogger.m */,
3652+
F891A6D42CB6F5D8007675F4 /* NRAutoLogCollector.h */,
3653+
F891A6BD2CB6F5C1007675F4 /* NRAutoLogCollector.m */,
36443654
02FF4A8224DC652C00115469 /* NRMAAppToken.h */,
36453655
02FF4A8E24DC652D00115469 /* NRMAAppToken.m */,
36463656
02FF4A8724DC652C00115469 /* NRMABase64.h */,
@@ -3867,6 +3877,14 @@
38673877
path = "DistributedTesting-Tests";
38683878
sourceTree = "<group>";
38693879
};
3880+
F8678AAD2CDBC62B008FD2A2 /* Logging Stress Tests */ = {
3881+
isa = PBXGroup;
3882+
children = (
3883+
F8678AAC2CDBC62B008FD2A2 /* NRAutoCollectLogStressTest.m */,
3884+
);
3885+
path = "Logging Stress Tests";
3886+
sourceTree = "<group>";
3887+
};
38703888
F8FBFA3C2A71A32400CDC8C5 /* Events */ = {
38713889
isa = PBXGroup;
38723890
children = (
@@ -5388,6 +5406,7 @@
53885406
02FF48F424DC623400115469 /* NRMAExceptionMetaDataStore.m in Sources */,
53895407
02FF4A2124DC648600115469 /* NRMASummaryMeasurementConsumer.m in Sources */,
53905408
02FF482924DB5BA500115469 /* NRMAFlags.m in Sources */,
5409+
F891A6BE2CB6F5C1007675F4 /* NRAutoLogCollector.m in Sources */,
53915410
02FF48D924DC622700115469 /* NRMACrashDataWriter.m in Sources */,
53925411
02FF487224DC618F00115469 /* NRGCDOverride.m in Sources */,
53935412
02FF494D24DC626E00115469 /* NRMAHarvesterConnection.m in Sources */,
@@ -5532,6 +5551,7 @@
55325551
025658C124EB2EE900FE3125 /* NRMAAnalyticsControllerStressor.m in Sources */,
55335552
025658CF24EB2F5B00FE3125 /* NRMAMeasurementProducerStressor.m in Sources */,
55345553
025658C424EB2F3100FE3125 /* NRMAHarvestControllerStressor.m in Sources */,
5554+
F8678AAE2CDBC62B008FD2A2 /* NRAutoCollectLogStressTest.m in Sources */,
55355555
025658D524EB2F6400FE3125 /* NRMAActivityTraceMeasurementCreatorStressor.m in Sources */,
55365556
025658DD24EB350300FE3125 /* NRAgentTestBase.m in Sources */,
55375557
025658D424EB2F6400FE3125 /* NRMASummaryMeasurementConsumerStressor.m in Sources */,
@@ -5558,6 +5578,7 @@
55585578
02FF4BF424E3201400115469 /* NRMAScopedHTTPTransactionMeasurement.m in Sources */,
55595579
02FF4BF524E3201400115469 /* NRMAMethodSwizzling.m in Sources */,
55605580
02FF4BF624E3201400115469 /* NRMACrashReporterRecorder.m in Sources */,
5581+
F891A6BF2CB6F5C1007675F4 /* NRAutoLogCollector.m in Sources */,
55615582
02FF4BF724E3201400115469 /* NRMACrashReport_CodeType.m in Sources */,
55625583
02FF4BF824E3201400115469 /* NRMAHarvestableHTTPTransaction.m in Sources */,
55635584
02FF4BF924E3201400115469 /* NRMAHarvestableActivity.m in Sources */,
@@ -5917,6 +5938,7 @@
59175938
3482325C2BC5F16E0070FAC3 /* NRMACPUVitals.m in Sources */,
59185939
348232502BC5F14D0070FAC3 /* NRMADEBUG_Reachability.m in Sources */,
59195940
348233532BC5F2780070FAC3 /* NRMAThread.m in Sources */,
5941+
F891A6C02CB6F5C1007675F4 /* NRAutoLogCollector.m in Sources */,
59205942
3482325D2BC5F16E0070FAC3 /* NRMABool.m in Sources */,
59215943
348233212BC5F2270070FAC3 /* NRMACrashReport_CodeType.m in Sources */,
59225944
3482328B2BC5F1B30070FAC3 /* NRMAMetric.m in Sources */,
@@ -6587,16 +6609,19 @@
65876609
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
65886610
ARCHS = "$(ARCHS_STANDARD)";
65896611
CLANG_ENABLE_CODE_COVERAGE = YES;
6612+
CODE_SIGN_IDENTITY = "Apple Development";
65906613
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
65916614
CODE_SIGN_STYLE = Automatic;
65926615
CURRENT_PROJECT_VERSION = 7.5.3;
65936616
DEVELOPMENT_TEAM = SU7SUNGZJP;
65946617
DYLIB_CURRENT_VERSION = 7.5.3;
6618+
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks";
65956619
HEADER_SEARCH_PATHS = (
65966620
"${PROJECT_DIR}/UnitTests/",
65976621
"${SRCROOT}/**",
65986622
);
65996623
INFOPLIST_FILE = "Tests/Stress-Tests/Info.plist";
6624+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
66006625
LD_RUNPATH_SEARCH_PATHS = (
66016626
"$(inherited)",
66026627
"@executable_path/Frameworks",
@@ -6626,16 +6651,19 @@
66266651
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
66276652
ARCHS = "$(ARCHS_STANDARD)";
66286653
CLANG_ENABLE_CODE_COVERAGE = YES;
6654+
CODE_SIGN_IDENTITY = "Apple Development";
66296655
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
66306656
CODE_SIGN_STYLE = Automatic;
66316657
CURRENT_PROJECT_VERSION = 7.5.3;
66326658
DEVELOPMENT_TEAM = SU7SUNGZJP;
66336659
DYLIB_CURRENT_VERSION = 7.5.3;
6660+
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks";
66346661
HEADER_SEARCH_PATHS = (
66356662
"${PROJECT_DIR}/UnitTests/",
66366663
"${SRCROOT}/**",
66376664
);
66386665
INFOPLIST_FILE = "Tests/Stress-Tests/Info.plist";
6666+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
66396667
LD_RUNPATH_SEARCH_PATHS = (
66406668
"$(inherited)",
66416669
"@executable_path/Frameworks",

Agent/FeatureFlags/NRMAFlags.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555

5656
+ (BOOL) shouldEnableBackgroundReporting;
5757

58+
+ (BOOL) shouldEnableAutoCollectLogs;
59+
5860
+ (NSArray<NSString*>*) namesForFlags:(NRMAFeatureFlags)flags;
5961

6062
// Private Setting

Agent/FeatureFlags/NRMAFlags.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ + (NRMAFeatureFlags) featureFlags
4747
NRFeatureFlag_NetworkRequestEvents |
4848
NRFeatureFlag_RequestErrorEvents |
4949
NRFeatureFlag_DistributedTracing |
50-
NRFeatureFlag_AppStartMetrics;
50+
NRFeatureFlag_AppStartMetrics |
51+
NRFeatureFlag_AutoCollectLogs;
5152
});
5253
return __flags;
5354
}
@@ -177,6 +178,10 @@ + (BOOL) shouldEnableBackgroundReporting {
177178
return ([NRMAFlags featureFlags] & NRFeatureFlag_BackgroundReporting) != 0;
178179
}
179180

181+
+ (BOOL) shouldEnableAutoCollectLogs {
182+
return ([NRMAFlags featureFlags] & NRFeatureFlag_AutoCollectLogs) != 0;
183+
}
184+
180185
+ (NSArray<NSString*>*) namesForFlags:(NRMAFeatureFlags)flags {
181186
NSMutableArray *retArray = [NSMutableArray array];
182187
if ((flags & NRFeatureFlag_InteractionTracing) == NRFeatureFlag_InteractionTracing) {
@@ -239,6 +244,9 @@ + (BOOL) shouldEnableBackgroundReporting {
239244
if ((flags & NRFeatureFlag_BackgroundReporting) == NRFeatureFlag_BackgroundReporting) {
240245
[retArray addObject:@"BackgroundReporting"];
241246
}
247+
if ((flags & NRFeatureFlag_AutoCollectLogs) == NRFeatureFlag_AutoCollectLogs) {
248+
[retArray addObject:@"AutoCollectLogs"];
249+
}
242250

243251
return retArray;
244252
}

Agent/General/NewRelicAgentInternal.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#import "NRMAStartTimer.h"
5454
#import "NRMAUDIDManager.h"
5555
#import "NRMASupportMetricHelper.h"
56+
#import "NRAutoLogCollector.h"
5657

5758

5859
// Support for teardown and re-setup of the agent within a process lifetime for our test harness

Agent/Harvester/NRMAHarvester.mm

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#import "NRMAFlags.h"
2323
#import "Constants.h"
2424
#import "NewRelicAgentInternal.h"
25+
#import "NewRelicInternalUtils.h"
26+
#import "NRAutoLogCollector.h"
2527

2628
#define kNRSupportabilityResponseCode kNRSupportabilityPrefix @"/Collector/ResponseStatusCodes"
2729

@@ -772,9 +774,14 @@ - (void) handleLoggingConfigurationUpdate {
772774
// This if/else chain should only be entered if log_reporting was found in the config
773775
if (configuration.has_log_reporting_config) {
774776
if (configuration.log_reporting_enabled) {
775-
776-
// it is required to enable NRLogTargetFile when using LogReporting.
777-
[NRLogger setLogTargets:NRLogTargetConsole | NRLogTargetFile];
777+
if ([NRMAFlags shouldEnableAutoCollectLogs] && ![NewRelicInternalUtils isDebuggerAttached]){
778+
[NRAutoLogCollector redirectStandardOutputAndError];
779+
// it is required to enable NRLogTargetFile when using LogReporting.
780+
[NRLogger setLogTargets:NRLogTargetFile];
781+
} else {
782+
[NRLogger setLogTargets:NRLogTargetConsole | NRLogTargetFile];
783+
}
784+
778785
// Parse NSString into NRLogLevel
779786
NRLogLevels level = [NRLogger stringToLevel: configuration.log_reporting_level];
780787
[NRLogger setRemoteLogLevel:level];
@@ -786,6 +793,9 @@ - (void) handleLoggingConfigurationUpdate {
786793
// OVERWRITE user selected value for LogReporting.
787794
else {
788795
NRLOG_AGENT_DEBUG(@"config: Has log reporting DISABLED");
796+
if ([NRMAFlags shouldEnableAutoCollectLogs]) {
797+
[NRAutoLogCollector restoreStandardOutputAndError];
798+
}
789799
[NRLogger setLogTargets:NRLogTargetConsole];
790800

791801
[NRMAFlags disableFeatures:NRFeatureFlag_LogReporting];

Agent/Public/NRLogger.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ withAttributes:(NSDictionary *)attributes;
132132
withMessage:(NSString *)message
133133
withAgentLogsOn:(BOOL)agentLogsOn;
134134

135+
+ (void) log:(unsigned int)level
136+
withMessage:(NSString *)message
137+
withTimestamp:(NSNumber *)timestamp;
138+
135139
/*!
136140
Configure the amount of information the New Relic agent outputs about its internal operation.
137141

Agent/Public/NewRelicFeatureFlags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ typedef NS_OPTIONS(unsigned long long, NRMAFeatureFlags){
102102
NRFeatureFlag_NewEventSystem = 1 << 20, // Disabled by default
103103
NRFeatureFlag_OfflineStorage = 1 << 21, // Disabled by default
104104
NRFeatureFlag_BackgroundReporting = 1 << 22, // Disabled by default
105-
105+
NRFeatureFlag_AutoCollectLogs = 1 << 23,
106106
};

Agent/Utilities/NRAutoLogCollector.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// NRAutoLogCollector.h
3+
// Agent
4+
//
5+
// Created by Mike Bruin on 10/9/24.
6+
// Copyright © 2024 New Relic. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface NRAutoLogCollector : NSObject {
12+
13+
14+
}
15+
16+
+ (BOOL) redirectStandardOutputAndError;
17+
+ (void) restoreStandardOutputAndError;
18+
+ (BOOL) hasRedirectedStdOut;
19+
20+
@end

0 commit comments

Comments
 (0)