log CHANGE use ly_vecode only if really necessary
avoid getting data when they are not necessary needed
diff --git a/src/log.c b/src/log.c
index 894bffb..3a96e4a 100644
--- a/src/log.c
+++ b/src/log.c
@@ -313,10 +313,6 @@
return;
}
- if (((no & ~LY_EPLUGIN) == LY_EVALID) && (vecode == LYVE_SUCCESS)) {
- /* assume we are inheriting the error, so inherit vecode as well */
- vecode = ly_vecode(ctx);
- }
/* store the error/warning (if we need to store errors internally, it does not matter what are the user log options) */
if ((level < LY_LLVRB) && ctx && (ly_log_opts & LY_LOSTORE)) {
@@ -326,6 +322,10 @@
free(path);
return;
}
+ if (((no & ~LY_EPLUGIN) == LY_EVALID) && (vecode == LYVE_SUCCESS)) {
+ /* assume we are inheriting the error, so inherit vecode as well */
+ vecode = ly_vecode(ctx);
+ }
if (log_store(ctx, level, no, vecode, msg, path, NULL)) {
return;
}