Log tags need to be shorter than 24 chars according to android docume… · Pull Request #1739 · androidannotations/androidannotations · GitHub
Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static com.helger.jcodemodel.JExpr.cast;
import static com.helger.jcodemodel.JExpr.lit;
import static org.androidannotations.helper.LogHelper.trimLogTagToSize;

import javax.lang.model.element.Element;
import javax.lang.model.type.TypeMirror;
Expand Down Expand Up @@ -82,7 +83,7 @@ public void assignValue(JBlock targetBlock, IJAssignmentTarget fieldRef, EBeanHo
cond._then().add(fieldRef.assign(cast(extendingContextClass, holder.getContextRef())));

JInvocation warningInvoke = getClasses().LOG.staticInvoke("w");
warningInvoke.arg(holder.getGeneratedClass().name());
warningInvoke.arg(trimLogTagToSize(holder.getGeneratedClass().name()));
warningInvoke.arg(lit("Due to Context class ").plus(holder.getContextRef().invoke("getClass").invoke("getSimpleName"))
.plus(lit(", the @RootContext " + extendingContextClass.name() + " won't be populated")));
cond._else().add(warningInvoke);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import com.helger.jcodemodel.JTryBlock;
import com.helger.jcodemodel.JVar;

import static org.androidannotations.helper.LogHelper.trimLogTagToSize;

public class TransactionalHandler extends BaseAnnotationHandler<EComponentHolder> {

public TransactionalHandler(AndroidAnnotationsEnvironment environment) {
Expand Down Expand Up @@ -102,7 +104,7 @@ public void process(Element element, EComponentHolder holder) {

JInvocation errorInvoke = catchBody.staticInvoke(getClasses().LOG, "e");

errorInvoke.arg(holder.getGeneratedClass().name());
errorInvoke.arg(trimLogTagToSize(holder.getGeneratedClass().name()));
errorInvoke.arg("Error in transaction");
errorInvoke.arg(exceptionParam);

Expand Down