File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,35 +130,31 @@ def tick():
130130http_mutex = threading .RLock ()
131131
132132
133- def logi (msg ):
134- """Prints a log message to 'info' stdout channel. Always printed."""
133+ def print_message (msg , file ):
135134 global last_message_time
136135 with http_mutex :
137- sys . stdout .write (msg + '\n ' )
138- sys . stdout .flush ()
136+ file .write (msg + '\n ' )
137+ file .flush ()
139138 last_message_time = tick ()
140139
141140
141+ def logi (msg ):
142+ """Prints a log message to stdout. Always printed."""
143+ print_message (msg , sys .stdout )
144+
145+
142146def logv (msg ):
143- """Prints a verbose log message to stdout channel .
147+ """Prints a verbose log message to stdout.
144148
145149 Only shown if run with --verbose.
146150 """
147- global last_message_time
148151 if emrun_options .verbose :
149- with http_mutex :
150- sys .stdout .write (msg + '\n ' )
151- sys .stdout .flush ()
152- last_message_time = tick ()
152+ print_message (msg , sys .stdout )
153153
154154
155155def loge (msg ):
156- """Prints an error message to stderr channel."""
157- global last_message_time
158- with http_mutex :
159- sys .stderr .write (msg + '\n ' )
160- sys .stderr .flush ()
161- last_message_time = tick ()
156+ """Prints an error message to stderr."""
157+ print_message (msg , sys .stderr )
162158
163159
164160def format_eol (msg ):
You can’t perform that action at this time.
0 commit comments