Skip to content

Commit

Permalink
Merge pull request #794 from wwang-chcn/suite_modular
Browse files Browse the repository at this point in the history
Move Bento analysis part here from GiottoClass
  • Loading branch information
jiajic authored Nov 17, 2023
2 parents 388847c + 8a543f8 commit 1d82077
Show file tree
Hide file tree
Showing 2 changed files with 451 additions and 0 deletions.
41 changes: 41 additions & 0 deletions R/log.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import sys
import time


def get_current_time() -> str:
return time.strftime('%H:%M:%S', time.localtime())


def write_direct_message(message: str):
curr_time_str = get_current_time()
sys.stdout.write(f'{curr_time_str} --- {message}\n')
sys.stdout.flush()


def debug(message: str):
write_direct_message(f'DEBUG: {message}')


def info(message: str):
write_direct_message(f'INFO: {message}')


def write_direct_message_err(message: str):
curr_time_str = get_current_time()
sys.stderr.write(f'{curr_time_str} --- {message}\n')
sys.stderr.flush()


def warning(message: str):
write_direct_message_err(f'WARNING: {message}')


def error(message: str):
write_direct_message_err(f'ERROR: {message}')


def critical(message: str):
write_direct_message_err(f'CRITICAL: {message}')


__all__ = ['debug', 'info', 'warning', 'error', 'critical']
Loading

0 comments on commit 1d82077

Please sign in to comment.