Просмотр исходного кода

Minor logging additions

- Clearly mark local and remote discovery start, to make this searchable
even without --logdebug.
- Promote two messages from debug to info: The 'N entries read from db'
message is useful and the 'read from db but ignored' message is rare
and surprising - if there's a bug there we want to see what happened in
the logs.
Christian Kamm 8 лет назад
Родитель
Сommit
51b662fdfe
2 измененных файлов с 6 добавлено и 2 удалено
  1. 4 0
      src/csync/csync.cpp
  2. 2 2
      src/csync/csync_update.cpp

+ 4 - 0
src/csync/csync.cpp

@@ -85,6 +85,8 @@ int csync_update(CSYNC *ctx) {
   csync_gettime(&start);
   ctx->current = LOCAL_REPLICA;
 
+  CSYNC_LOG(CSYNC_LOG_PRIORITY_INFO, "## Starting local discovery ##");
+
   rc = csync_ftw(ctx, ctx->local.uri, csync_walker, MAX_DEPTH);
   if (rc < 0) {
     if(ctx->status_code == CSYNC_STATUS_OK) {
@@ -104,6 +106,8 @@ int csync_update(CSYNC *ctx) {
   csync_gettime(&start);
   ctx->current = REMOTE_REPLICA;
 
+  CSYNC_LOG(CSYNC_LOG_PRIORITY_INFO, "## Starting remote discovery ##");
+
   rc = csync_ftw(ctx, "", csync_walker, MAX_DEPTH);
   if (rc < 0) {
       if(ctx->status_code == CSYNC_STATUS_OK) {

+ 2 - 2
src/csync/csync_update.cpp

@@ -497,7 +497,7 @@ static bool fill_tree_from_db(CSYNC *ctx, const char *uri)
          * without a full remote discovery being triggered. */
         CSYNC_EXCLUDE_TYPE excluded = csync_excluded_traversal(ctx, st->path, st->type);
         if (excluded != CSYNC_NOT_EXCLUDED) {
-            qDebug(lcUpdate, "%s excluded (%d)", st->path.constData(), excluded);
+            qInfo(lcUpdate, "%s excluded from db read (%d)", st->path.constData(), excluded);
 
             if (excluded == CSYNC_FILE_EXCLUDE_AND_REMOVE
                     || excluded == CSYNC_FILE_SILENTLY_EXCLUDED) {
@@ -516,7 +516,7 @@ static bool fill_tree_from_db(CSYNC *ctx, const char *uri)
         ctx->status_code = CSYNC_STATUS_STATEDB_LOAD_ERROR;
         return false;
     }
-    qDebug(lcUpdate, "%" PRId64 " entries read below path %s from db.", count, uri);
+    qInfo(lcUpdate, "%" PRId64 " entries read below path %s from db.", count, uri);
 
     return true;
 }