File tree Expand file tree Collapse file tree 2 files changed +33
-20
lines changed Expand file tree Collapse file tree 2 files changed +33
-20
lines changed Original file line number Diff line number Diff line change @@ -30,28 +30,9 @@ def invoke_main():
30
30
# behavior of std out as if it were a terminal.
31
31
sys .stdout .reconfigure (line_buffering = True )
32
32
global bootstrap_main
33
- from monarch ._rust_bindings .hyperactor_extension .telemetry import ( # @manual=//monarch/monarch_extension:monarch_extension # @manual=//monarch/monarch_extension:monarch_extension
34
- forward_to_tracing ,
35
- )
36
33
37
34
# TODO: figure out what from worker_main.py we should reproduce here.
38
-
39
- class TracingForwarder (logging .Handler ):
40
- def emit (self , record : logging .LogRecord ) -> None :
41
- try :
42
- forward_to_tracing (
43
- record .getMessage (),
44
- record .filename or "" ,
45
- record .lineno or 0 ,
46
- record .levelno ,
47
- )
48
- except AttributeError :
49
- forward_to_tracing (
50
- record .__str__ (),
51
- record .filename or "" ,
52
- record .lineno or 0 ,
53
- record .levelno ,
54
- )
35
+ from monarch .telemetry import TracingForwarder
55
36
56
37
if os .environ .get ("MONARCH_ERROR_DURING_BOOTSTRAP_FOR_TESTING" ) == "1" :
57
38
raise RuntimeError ("Error during bootstrap for testing" )
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+ #
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ # pyre-strict
8
+
9
+
10
+ import logging
11
+
12
+ from monarch ._rust_bindings .hyperactor_extension .telemetry import ( # @manual=//monarch/monarch_extension:monarch_extension
13
+ forward_to_tracing ,
14
+ )
15
+
16
+
17
+ class TracingForwarder (logging .Handler ):
18
+ def emit (self , record : logging .LogRecord ) -> None :
19
+ try :
20
+ forward_to_tracing (
21
+ record .getMessage (),
22
+ record .filename or "" ,
23
+ record .lineno or 0 ,
24
+ record .levelno ,
25
+ )
26
+ except AttributeError :
27
+ forward_to_tracing (
28
+ record .__str__ (),
29
+ record .filename or "" ,
30
+ record .lineno or 0 ,
31
+ record .levelno ,
32
+ )
You can’t perform that action at this time.
0 commit comments