code: def logging(s, log_path, print_=True, log_=True):
      if print_:
          print(s)
      if log_:
          with open(log_path, "a+") as f_log:
              f_log.write(s + "\n")
  
file_path: colossalai/examples/community/roberta/pretraining/utils/exp_util.py
imports: import functools
  import os
  import shutil
  import psutil
  import torch
  from colossalai.legacy.core import global_context
label_desc: Use image node_id 1 for calling a global function with example usage: logging(s, log_path, print_, log_) without return types