File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- """Stub for logging utilities. Right now just meant to avoid raw prints."""
15+ """Logging utilities."""
16+ from absl import logging
1617
1718
1819def log (user_str ):
19- print (user_str , flush = True )
20+ """Logs a message at the INFO level."""
21+ # Note, stacklevel=2 makes the log show the caller of this function.
22+ logging .info (user_str , stacklevel = 2 )
23+
24+
25+ def debug (user_str ):
26+ """Logs a message at the DEBUG level."""
27+ logging .debug (user_str , stacklevel = 2 )
28+
29+
30+ def info (user_str ):
31+ """Logs a message at the INFO level."""
32+ logging .info (user_str , stacklevel = 2 )
33+
34+
35+ def warning (user_str ):
36+ """Logs a message at the WARNING level."""
37+ logging .warning (user_str , stacklevel = 2 )
38+
39+
40+ def error (user_str ):
41+ """Logs a message at the ERROR level."""
42+ logging .error (user_str , stacklevel = 2 )
You can’t perform that action at this time.
0 commit comments