File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
Test Harness/NRTestApp/NRTestApp/ViewModels Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -56,15 +56,15 @@ - (void)setObject:(nonnull id)object forKey:(nonnull id)key {
56
56
@synchronized (store) {
57
57
store[key] = object;
58
58
_dirty = YES ;
59
- NRLOG_VERBOSE (@" Marked dirty for adding" );
59
+ NRLOG_AUDIT (@" Marked dirty for adding" );
60
60
}
61
61
62
- NRLOG_VERBOSE (@" Scheduling block" );
62
+ NRLOG_AUDIT (@" Scheduling block" );
63
63
[self performWrite: ^ {
64
- NRLOG_VERBOSE (@" Entered block" );
64
+ NRLOG_AUDIT (@" Entered block" );
65
65
@synchronized (self) {
66
66
if (!self->_dirty ) {
67
- NRLOG_VERBOSE (@" Not writing file because it's not dirty" );
67
+ NRLOG_AUDIT (@" Not writing file because it's not dirty" );
68
68
return ;
69
69
}
70
70
}
@@ -157,7 +157,7 @@ - (void)saveToFile {
157
157
if (!success) {
158
158
NRLOG_ERROR (@" Error saving data: %@ " , error.description );
159
159
} else {
160
- NRLOG_VERBOSE (@" Wrote file" );
160
+ NRLOG_AUDIT (@" Wrote file" );
161
161
_lastSave = [NSDate new ];
162
162
}
163
163
}
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ class UtilViewModel {
44
44
options. append ( UtilOption ( title: " Notice Network Failure " , handler: { [ self ] in noticeFailedNWRequest ( ) } ) )
45
45
46
46
options. append ( UtilOption ( title: " Test Log Dict " , handler: { [ self ] in testLogDict ( ) } ) )
47
+ options. append ( UtilOption ( title: " Test Log Error " , handler: { [ self ] in testLogError ( ) } ) )
48
+ options. append ( UtilOption ( title: " Test Log Attributes " , handler: { [ self ] in testLogAttributes ( ) } ) )
47
49
48
50
options. append ( UtilOption ( title: " Make 100 Logs " , handler: { [ self ] in make100Logs ( ) } ) )
49
51
options. append ( UtilOption ( title: " Make 100 Special Character Logs " , handler: { [ self ] in make100SpecialCharacterLogs ( ) } ) )
@@ -138,7 +140,22 @@ class UtilViewModel {
138
140
" message " : " This is a test message for the New Relic logging system. "
139
141
] )
140
142
}
143
+ func testLogError( ) {
141
144
145
+ do {
146
+ try errorMethod ( )
147
+ } catch {
148
+ NewRelic . logErrorObject ( error)
149
+ }
150
+ }
151
+
152
+ // TODO: Wrap up attributes handling as a part of NR-227300
153
+ func testLogAttributes( ) {
154
+ NewRelic . logAttributes ( [
155
+ " logLevel " : " WARN " ,
156
+ " message " : " This is a test message for the New Relic logging system. "
157
+ ] )
158
+ }
142
159
143
160
144
161
func noticeNWRequest( ) {
You can’t perform that action at this time.
0 commit comments