@@ -76,6 +76,7 @@ def __init__(
7676 body : AnyValue = None ,
7777 attributes : Optional [_ExtendedAttributes ] = None ,
7878 event_name : Optional [str ] = None ,
79+ exception : Optional [BaseException ] = None ,
7980 ) -> None : ...
8081
8182 @overload
@@ -94,6 +95,7 @@ def __init__(
9495 severity_number : Optional [SeverityNumber ] = None ,
9596 body : AnyValue = None ,
9697 attributes : Optional [_ExtendedAttributes ] = None ,
98+ exception : Optional [BaseException ] = None ,
9799 ) -> None : ...
98100
99101 def __init__ (
@@ -110,6 +112,7 @@ def __init__(
110112 body : AnyValue = None ,
111113 attributes : Optional [_ExtendedAttributes ] = None ,
112114 event_name : Optional [str ] = None ,
115+ exception : Optional [BaseException ] = None ,
113116 ) -> None :
114117 if not context :
115118 context = get_current ()
@@ -127,6 +130,7 @@ def __init__(
127130 self .body = body
128131 self .attributes = attributes
129132 self .event_name = event_name
133+ self .exception = exception
130134
131135
132136class Logger (ABC ):
@@ -157,6 +161,7 @@ def emit(
157161 body : AnyValue | None = None ,
158162 attributes : _ExtendedAttributes | None = None ,
159163 event_name : str | None = None ,
164+ exception : BaseException | None = None ,
160165 ) -> None : ...
161166
162167 @overload
@@ -178,6 +183,7 @@ def emit(
178183 body : AnyValue | None = None ,
179184 attributes : _ExtendedAttributes | None = None ,
180185 event_name : str | None = None ,
186+ exception : BaseException | None = None ,
181187 ) -> None :
182188 """Emits a :class:`LogRecord` representing a log to the processing pipeline."""
183189
@@ -200,6 +206,7 @@ def emit(
200206 body : AnyValue | None = None ,
201207 attributes : _ExtendedAttributes | None = None ,
202208 event_name : str | None = None ,
209+ exception : BaseException | None = None ,
203210 ) -> None : ...
204211
205212 @overload
@@ -220,6 +227,7 @@ def emit(
220227 body : AnyValue | None = None ,
221228 attributes : _ExtendedAttributes | None = None ,
222229 event_name : str | None = None ,
230+ exception : BaseException | None = None ,
223231 ) -> None :
224232 pass
225233
@@ -266,6 +274,7 @@ def emit(
266274 body : AnyValue | None = None ,
267275 attributes : _ExtendedAttributes | None = None ,
268276 event_name : str | None = None ,
277+ exception : BaseException | None = None ,
269278 ) -> None : ...
270279
271280 @overload
@@ -286,6 +295,7 @@ def emit(
286295 body : AnyValue | None = None ,
287296 attributes : _ExtendedAttributes | None = None ,
288297 event_name : str | None = None ,
298+ exception : BaseException | None = None ,
289299 ) -> None :
290300 if record :
291301 self ._logger .emit (record )
@@ -299,6 +309,7 @@ def emit(
299309 body = body ,
300310 attributes = attributes ,
301311 event_name = event_name ,
312+ exception = exception ,
302313 )
303314
304315
0 commit comments