#!groovy

import java.text.SimpleDateFormat
import java.util.Date

def getTimestamp() {
  def dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
  return dateFormat.format(new Date())
}

def info(plugin, message) {
  echo "[${getTimestamp()}] [INFO] ${plugin} - ${message}"
}

def warn(plugin, message) {
  echo "[${getTimestamp()}] [WARN] ${plugin} - ${message}"
}

def error(plugin, message) {
  echo "[${getTimestamp()}] [ERROR] ${plugin} - ${message}"
  error(message)
}