package com.ruoyi;

import com.ruoyi.common.utils.JsonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest("--spring.profiles.active=local")
public abstract class TestSuper {

  protected final Logger log = LoggerFactory.getLogger(this.getClass());

  protected void out(Object obj) {
    if(obj instanceof String){
      log.debug(obj.toString());
    }else {
      log.debug(JsonUtils.toPrettyString(obj));
    }
  }

  protected void out(Object obj,Throwable th) {
    if(obj instanceof String){
      log.debug(obj.toString(),th);
    }else {
      log.debug(JsonUtils.toPrettyString(obj),th);
    }
  }
}
