code: public static void printErrorLog(int taskId, Logger logger, String message, Exception e) {
          if(e == null) {
              logger.error("Task id " + Integer.toString(taskId) + "] " + message);
          } else {
              logger.error("Task id " + Integer.toString(taskId) + "] " + message, e);
          }
      }
docs: Print log to the following logger ( Error level )
  
  @param taskId Stealer node id
  @param logger Logger class
  @param message The message to print