logger BUGFIX passing error information from an extension plugin

Error messages received from extension plugins have assigned special
LY_ERR value (LY_EPLUGIN) to mark them as something outside libyang
itself. But so far this value just replaced the original LY_ERR value of
the message, so now the LY_EPLUGIN has the value 128 (0x80) to allow its
ORing with other LY_ERR values.
diff --git a/src/log.c b/src/log.c
index 22d6855..f2d79b4 100644
--- a/src/log.c
+++ b/src/log.c
@@ -297,7 +297,7 @@
         return;
     }
 
-    if ((no == LY_EVALID) && (vecode == LYVE_SUCCESS)) {
+    if (((no & ~LY_EPLUGIN) == LY_EVALID) && (vecode == LYVE_SUCCESS)) {
         /* assume we are inheriting the error, so inherit vecode as well */
         vecode = ly_vecode(ctx);
     }
@@ -483,7 +483,7 @@
     }
 
     va_start(ap, format);
-    log_vprintf(ext->module->ctx, level, (level == LY_LLERR ? LY_EPLUGIN : 0), err_no, path ? strdup(path) : NULL, plugin_msg, ap);
+    log_vprintf(ext->module->ctx, level, (level == LY_LLERR ? LY_EPLUGIN : 0) | err_no, LYVE_OTHER, path ? strdup(path) : NULL, plugin_msg, ap);
     va_end(ap);
 
     free(plugin_msg);
diff --git a/src/log.h b/src/log.h
index 74a12c4..e71608f 100644
--- a/src/log.h
+++ b/src/log.h
@@ -149,12 +149,14 @@
     LY_ENOTFOUND,   /**< Item does not exists */
     LY_EINT,        /**< Internal error */
     LY_EVALID,      /**< Validation failure */
-    LY_EPLUGIN,     /**< Error reported by a plugin */
     LY_EDENIED,     /**< Operation is not allowed */
     LY_EINCOMPLETE, /**< The operation did not failed, but for some reason it was not possible to finish it completely.
                          According to the specific use case, the caller is usually supposed to perform the operation again. */
     LY_ENOT,        /**< Negative result */
-    LY_EOTHER       /**< Unknown error */
+    LY_EOTHER,      /**< Unknown error */
+
+    LY_EPLUGIN = 128/**< Error reported by a plugin - the highest bit in the first byte is set.
+                         This value is used ORed with one of the other LY_ERR value and can be simply masked. */
 } LY_ERR;
 
 /**
@@ -173,6 +175,8 @@
     LYVE_SEMANTICS,    /**< generic semantic error */
     LYVE_SYNTAX_XML,   /**< XML-related syntax error */
     LYVE_DATA,         /**< YANG data does not reflect some of the module restrictions */
+
+    LYVE_OTHER         /**< Unknown error */
 } LY_VECODE;
 
 /**