use of org.dbflute.bhv.logging.invoke.BehaviorInvokeNameResult in project dbflute-core by dbflute.
the class BehaviorCommandInvoker method saveInvokePath.
protected void saveInvokePath(BehaviorInvokePathResult invokePathResult) {
final BehaviorInvokeNameResult behaviorInvokeNameResult = invokePathResult.getBehaviorInvokeNameResult();
final String invokePath = invokePathResult.getInvokePath();
final String callerExp = behaviorInvokeNameResult.getInvocationExp();
final String omitMark = BehaviorInvokePathBuilder.OMIT_MARK;
InternalMapContext.setSavedInvokePath(Srl.substringLastFront(invokePath, omitMark) + callerExp);
}
use of org.dbflute.bhv.logging.invoke.BehaviorInvokeNameResult in project dbflute-core by dbflute.
the class BehaviorCommandInvoker method createUnknownInvokeNameResult.
protected BehaviorInvokeNameResult createUnknownInvokeNameResult() {
// basically no way
final String unknownKeyword;
if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) {
// e.g. OutsideSql engine use
final OutsideSqlContext context = OutsideSqlContext.getOutsideSqlContextOnThread();
unknownKeyword = context.getTableDbName();
} else {
unknownKeyword = "Unknown";
}
final String expNoMethodSuffix = unknownKeyword + ".invoke";
return new BehaviorInvokeNameResult(expNoMethodSuffix + "()", expNoMethodSuffix, null, null);
}
use of org.dbflute.bhv.logging.invoke.BehaviorInvokeNameResult 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