libyang REFACTOR simplify logging and extend location information

Simplify logger interface by using location information maintained in
the background. logger now prints all the available information: schema
path, data path and line numbers. However, the line number are quite
inaccurate (e.g. points to XML closing parent element) and some future
tuning would be great.
diff --git a/src/parser_yang.c b/src/parser_yang.c
index 71dd843..f3d98fe 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -4477,7 +4477,6 @@
     LY_CHECK_ERR_RET(!(*context), LOGMEM(ly_ctx), LY_EMEM);
     (*context)->format = LYS_IN_YANG;
     (*context)->unres = main_ctx->unres;
-    (*context)->pos_type = LY_VLOG_LINE;
     (*context)->in = in;
 
     mod_p = calloc(1, sizeof *mod_p);
@@ -4486,6 +4485,8 @@
     mod_p->parsing = 1;
     (*context)->parsed_mod = (struct lysp_module *)mod_p;
 
+    LOG_LOCINIT(PARSER_CTX(*context), NULL, NULL, NULL, in);
+
     /* map the typedefs and groupings list from main context to the submodule's context */
     memcpy(&(*context)->tpdfs_nodes, &main_ctx->tpdfs_nodes, sizeof main_ctx->tpdfs_nodes);
     memcpy(&(*context)->grps_nodes, &main_ctx->grps_nodes, sizeof main_ctx->grps_nodes);
@@ -4525,6 +4526,7 @@
     *submod = mod_p;
 
 cleanup:
+    LOG_LOCBACK(PARSER_CTX(*context), 0, 0, 0, 1);
     if (ret) {
         lysp_module_free((struct lysp_module *)mod_p);
         yang_parser_ctx_free(*context);
@@ -4548,7 +4550,6 @@
     LY_CHECK_ERR_RET(!(*context), LOGMEM(mod->ctx), LY_EMEM);
     (*context)->format = LYS_IN_YANG;
     (*context)->unres = unres;
-    (*context)->pos_type = LY_VLOG_LINE;
     (*context)->in = in;
 
     mod_p = calloc(1, sizeof *mod_p);
@@ -4557,6 +4558,8 @@
     mod_p->parsing = 1;
     (*context)->parsed_mod = mod_p;
 
+    LOG_LOCINIT(PARSER_CTX(*context), NULL, NULL, NULL, in);
+
     /* skip redundant but valid characters at the beginning */
     ret = skip_redundant_chars(*context);
     LY_CHECK_GOTO(ret, cleanup);
@@ -4592,6 +4595,7 @@
     mod->parsed = mod_p;
 
 cleanup:
+    LOG_LOCBACK(PARSER_CTX(*context), 0, 0, 0, 1);
     if (ret) {
         lysp_module_free(mod_p);
         yang_parser_ctx_free(*context);