use of org.dbflute.bhv.logging.invoke.BehaviorInvokePathResult in project dbflute-core by dbflute.
the class BehaviorCommandInvoker method logInvocation.
// ===================================================================================
// Log Invocation
// ==============
protected <RESULT> void logInvocation(BehaviorCommand<RESULT> behaviorCommand, boolean saveOnly) {
final StackTraceElement[] stackTrace = new Exception().getStackTrace();
final BehaviorInvokeNameResult behaviorInvokeNameResult = extractBehaviorInvoke(behaviorCommand, stackTrace);
saveBehaviorInvokeName(behaviorInvokeNameResult);
final BehaviorInvokePathResult invokePathResult = buildInvokePath(behaviorCommand, stackTrace, behaviorInvokeNameResult);
if (invokePathResult != null) {
saveClientInvokeName(invokePathResult);
saveByPassInvokeName(invokePathResult);
saveInvokePath(invokePathResult);
}
if (saveOnly) {
// e.g. log level is INFO and invocation path ready
return;
}
final String expNoMethodSuffix = behaviorInvokeNameResult.getInvocationExpNoMethodSuffix();
final String equalBorder = buildFitBorder("", "=", expNoMethodSuffix, false);
final String frameBase = "/=====================================================";
final String spaceBase = " ";
log(frameBase + equalBorder + "==");
log(spaceBase + behaviorInvokeNameResult.getInvocationExp());
log(spaceBase + equalBorder + "=/");
if (invokePathResult != null) {
final String invokePath = invokePathResult.getInvokePath();
if (Srl.is_NotNull_and_NotTrimmedEmpty(invokePath)) {
// just in case
log(invokePath);
}
}
if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) {
final OutsideSqlContext outsideSqlContext = getOutsideSqlContext();
if (outsideSqlContext != null) {
log("path: " + behaviorCommand.getOutsideSqlPath());
log("option: " + behaviorCommand.getOutsideSqlOption());
}
}
}
Aggregations