File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ protected override void Write(LogEventInfo logEvent)
188188 // If this is true, an exception is being logged with no custom message
189189 if ( exception != null && ! message . StartsWith ( exception . Message ) )
190190 {
191- // Exception.Message won't be used as Breadcrumb message Avoid losing it by adding as data:
191+ // Exception won't be used as Breadcrumb message. Avoid losing it by adding as data:
192192 data = new Dictionary < string , string >
193193 {
194194 { "exception_type" , exception . GetType ( ) . ToString ( ) } ,
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ public void Log_WithException_CreatesEventWithException()
154154 }
155155
156156 [ Fact ]
157- public void Log_WithException_BreadcrumbFromException ( )
157+ public void Log_WithOnlyException_GeneratesBreadcrumbFromException ( )
158158 {
159159 var expectedException = new Exception ( "expected message" ) ;
160160
@@ -171,7 +171,9 @@ public void Log_WithException_BreadcrumbFromException()
171171 Assert . Null ( b . Category ) ;
172172 Assert . Equal ( b . Level , expectedLevel ) ;
173173 Assert . Null ( b . Type ) ;
174- Assert . Null ( b . Data ) ;
174+ Assert . NotNull ( b . Data ) ;
175+ Assert . Equal ( expectedException . GetType ( ) . ToString ( ) , b . Data [ "exception_type" ] ) ;
176+ Assert . Equal ( expectedException . Message , b . Data [ "exception_message" ] ) ;
175177 }
176178
177179 [ Fact ]
You can’t perform that action at this time.
0 commit comments