/**
   * This method is called before every method execution
   *
   * @param joinPoint
   */
  @Before("firstPointcut() && secondPointcut()")
  public void logMethodEntry(JoinPoint joinPoint) {
    // If the bug is disabled, do not log anything
    if (!this.isBugEnabled()) {
      return;
    }

    Date date = new Date();

    MessageDigest md = null;
    try {
      md = MessageDigest.getInstance("SHA");
    } catch (NoSuchAlgorithmException e) {
      throw new RuntimeException(e);
    }
    String key = new String(md.digest(joinPoint.getSignature().toShortString().getBytes()));
    Statistic stat = new Statistic();
    if (allStats.containsKey(key)) {
      stat = allStats.get(key);
    }
    stat.lastDate = date;
    allStats.put(key, stat);

    String className = joinPoint.getSignature().getDeclaringType().getCanonicalName();
    String method = joinPoint.getSignature().toShortString();
    StringBuffer sb =
        new StringBuffer("IN: Class: ")
            .append(className)
            .append(" Method: ")
            .append(method)
            .append(" called with args: [");
    for (Object o : joinPoint.getArgs()) {
      sb.append(o.toString()).append(", ");
    }
    sb.append("] at [");
    sb.append(formatDate(date));
    sb.append("]");

    LOGGER.debug(sb.toString());
  }