From: Kern Sibbald Date: Sat, 29 Oct 2011 10:34:16 +0000 (+0200) Subject: Put Win exchange plugin debug code on level 100 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c52515b82bbba67ab1be29f08c5fa76fb8ae9eb2;p=bacula%2Fbacula Put Win exchange plugin debug code on level 100 --- diff --git a/bacula/src/win32/filed/plugins/dbi_node.c b/bacula/src/win32/filed/plugins/dbi_node.c index 76ff0c0f14..a7d2274070 100644 --- a/bacula/src/win32/filed/plugins/dbi_node.c +++ b/bacula/src/win32/filed/plugins/dbi_node.c @@ -86,7 +86,7 @@ dbi_node_t::endBackupFile(exchange_fd_context_t *context) bRC dbi_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) { - _DebugMessage(0, "createFile_DBI state = %d\n", state); + _ DebugMessage(100, "createFile_DBI state = %d\n", state); rp->create_status = CF_EXTRACT; @@ -96,7 +96,7 @@ dbi_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) bRC dbi_node_t::endRestoreFile(exchange_fd_context_t *context) { - _DebugMessage(0, "endRestoreFile_DBI state = %d\n", state); + _ DebugMessage(100, "endRestoreFile_DBI state = %d\n", state); context->current_node = parent; diff --git a/bacula/src/win32/filed/plugins/exchange-fd.c b/bacula/src/win32/filed/plugins/exchange-fd.c index 1fd0541375..a8a0dbaca8 100644 --- a/bacula/src/win32/filed/plugins/exchange-fd.c +++ b/bacula/src/win32/filed/plugins/exchange-fd.c @@ -170,7 +170,7 @@ static bRC newPlugin(bpContext *ctx) context->notrunconfull_option = false; context->plugin_active = false; bfuncs->getBaculaValue(ctx, bVarJobId, (void *)&JobId); - _DebugMessage(0, "newPlugin JobId=%d\n", JobId); + _DebugMessage(100, "newPlugin JobId=%d\n", JobId); bfuncs->registerBaculaEvents(ctx, 1, 2, 0); size = MAX_COMPUTERNAME_LENGTH + 1; context->computer_name = new WCHAR[size]; @@ -218,14 +218,14 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) switch (event->eventType) { case bEventJobStart: - _DebugMessage(0, "JobStart=%s\n", (char *)value); + _DebugMessage(100, "JobStart=%s\n", (char *)value); context->plugin_active = false; break; case bEventJobEnd: - _DebugMessage(0, "JobEnd\n"); + _DebugMessage(100, "JobEnd\n"); break; case bEventPluginCommand: - _DebugMessage(0, "bEventPluginCommand %s\n", value); + _DebugMessage(100, "bEventPluginCommand %s\n", value); command = bstrdup((char *)value); /* this isn't really unused */ plugin_name = strtok((char *)command, ":"); @@ -240,7 +240,7 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) if (!context->plugin_active) { break; } - _DebugMessage(0, "BackupStart\n"); + _DebugMessage(100, "BackupStart\n"); bfuncs->getBaculaValue(ctx, bVarAccurate, (void *)&accurate); context->accurate = accurate; context->job_type = JOB_TYPE_BACKUP; @@ -261,12 +261,12 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) context->truncate_logs = false; break; default: - _DebugMessage(0, "Invalid job level %c\n", context->job_level); + _DebugMessage(100, "Invalid job level %c\n", context->job_level); return bRC_Error; } break; case bEventEndBackupJob: - _DebugMessage(0, "BackupEnd\n"); + _DebugMessage(100, "BackupEnd\n"); if (!context->plugin_active) { break; } @@ -276,7 +276,7 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) break; } intval = (intptr_t)value; - _DebugMessage(0, "JobLevel=%c %d\n", intval, intval); + _DebugMessage(100, "JobLevel=%c %d\n", intval, intval); context->job_level = intval; break; case bEventSince: @@ -284,11 +284,11 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) break; } intval = (intptr_t)value; - _DebugMessage(0, "since=%d\n", intval); + _DebugMessage(100, "since=%d\n", intval); context->job_since = (time_t)value; break; case bEventStartRestoreJob: - _DebugMessage(0, "StartRestoreJob\n"); + _DebugMessage(100, "StartRestoreJob\n"); context->job_type = JOB_TYPE_RESTORE; context->plugin_active = true; break; @@ -296,13 +296,13 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) if (!context->plugin_active) { break; } - _DebugMessage(0, "EndRestoreJob\n"); + _DebugMessage(100, "EndRestoreJob\n"); context->plugin_active = false; break; /* Plugin command e.g. plugin = ::command */ case bEventRestoreCommand: - _DebugMessage(0, "restore\n"); // command=%s\n", (char *)value); + _DebugMessage(100, "restore\n"); // command=%s\n", (char *)value); if (!context->plugin_active) { break; } @@ -313,7 +313,7 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) break; } { - _DebugMessage(0, "backup command=%s\n", (char *)value); + _DebugMessage(100, "backup command=%s\n", (char *)value); char *command = new char[strlen((char *)value) + 1]; strcpy(command, (char *)value); char *plugin_name = strtok((char *)command, ":"); @@ -327,8 +327,8 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) _JobMessage(M_WARNING, "Unknown plugin option '%s'\n", option); } } - _DebugMessage(0, "name = %s\n", plugin_name); - _DebugMessage(0, "path = %s\n", path); + _DebugMessage(100, "name = %s\n", plugin_name); + _DebugMessage(100, "path = %s\n", path); if (*path != '/') { _JobMessage(M_FATAL, "Path does not begin with a '/'\n"); return bRC_Error; @@ -356,7 +356,7 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) break; default: - _DebugMessage(0, "Ignored event=%d\n", event->eventType); + _DebugMessage(100, "Ignored event=%d\n", event->eventType); break; } bfuncs->getBaculaValue(ctx, bVarFDName, (void *)&name); @@ -522,4 +522,3 @@ static bRC checkFile(bpContext *ctx, char *fname) /* previous files are always Seen */ return bRC_Seen; } - diff --git a/bacula/src/win32/filed/plugins/file_node.c b/bacula/src/win32/filed/plugins/file_node.c index fe3b9b6610..e09918d93c 100644 --- a/bacula/src/win32/filed/plugins/file_node.c +++ b/bacula/src/win32/filed/plugins/file_node.c @@ -97,7 +97,7 @@ file_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) { //HrESERestoreOpenFile with name of log file - _DebugMessage(0, "createFile_FILE state = %d\n", state); + _ DebugMessage(100, "createFile_FILE state = %d\n", state); rp->create_status = CF_EXTRACT; return bRC_OK; } @@ -105,7 +105,7 @@ file_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) bRC file_node_t::endRestoreFile(exchange_fd_context_t *context) { - _DebugMessage(0, "endRestoreFile_FILE state = %d\n", state); + _ DebugMessage(100, "endRestoreFile_FILE state = %d\n", state); context->current_node = parent; return bRC_OK; } @@ -118,7 +118,7 @@ file_node_t::pluginIoOpen(exchange_fd_context_t *context, struct io_pkt *io) char *tmp = new char[wcslen(filename) + 1]; wcstombs(tmp, filename, wcslen(filename) + 1); - _DebugMessage(0, "pluginIoOpen_FILE - filename = %s\n", tmp); + _ DebugMessage(100, "pluginIoOpen_FILE - filename = %s\n", tmp); io->status = 0; io->io_errno = 0; if (context->job_type == JOB_TYPE_BACKUP) diff --git a/bacula/src/win32/filed/plugins/root_node.c b/bacula/src/win32/filed/plugins/root_node.c index d5ba41dbde..4179c51c1d 100644 --- a/bacula/src/win32/filed/plugins/root_node.c +++ b/bacula/src/win32/filed/plugins/root_node.c @@ -112,7 +112,7 @@ root_node_t::endBackupFile(exchange_fd_context_t *context) bRC root_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) { - _DebugMessage(0, "createFile_ROOT state = %d\n", state); + _ DebugMessage(100, "createFile_ROOT state = %d\n", state); switch (state) { case 0: if (strcmp(name, PLUGIN_PATH_PREFIX_BASE) != 0) { @@ -144,7 +144,7 @@ root_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) bRC root_node_t::endRestoreFile(exchange_fd_context_t *context) { - _DebugMessage(0, "endRestoreFile_ROOT state = %d\n", state); + _ DebugMessage(100, "endRestoreFile_ROOT state = %d\n", state); switch (state) { case 0: delete service_node; diff --git a/bacula/src/win32/filed/plugins/service_node.c b/bacula/src/win32/filed/plugins/service_node.c index 9b2b7e3715..2846106884 100644 --- a/bacula/src/win32/filed/plugins/service_node.c +++ b/bacula/src/win32/filed/plugins/service_node.c @@ -171,7 +171,7 @@ service_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *r { storage_group_node_t *curr_sg, *prev_sg; - _DebugMessage(0, "createFile_SERVICE state = %d\n", state); + _ DebugMessage(100, "createFile_SERVICE state = %d\n", state); if (strcmp(name, "Microsoft Information Store") != 0) { _JobMessage(M_FATAL, "Invalid restore path specified, must start with '/" PLUGIN_PATH_PREFIX_BASE "/" PLUGIN_PATH_PREFIX_SERVICE "/'\n", state); @@ -215,7 +215,7 @@ service_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *r bRC service_node_t::endRestoreFile(exchange_fd_context_t *context) { - _DebugMessage(0, "endRestoreFile_SERVICE state = %d\n", state); + _ DebugMessage(100, "endRestoreFile_SERVICE state = %d\n", state); switch(state) { case 0: diff --git a/bacula/src/win32/filed/plugins/storage_group_node.c b/bacula/src/win32/filed/plugins/storage_group_node.c index a194e5448f..b0ce794c72 100644 --- a/bacula/src/win32/filed/plugins/storage_group_node.c +++ b/bacula/src/win32/filed/plugins/storage_group_node.c @@ -309,11 +309,11 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_ HRESULT result; int len; - _DebugMessage(0, "createFile_STORAGE_GROUP state = %d\n", state); + _ DebugMessage(100, "createFile_STORAGE_GROUP state = %d\n", state); if (strcmp(context->path_bits[level], name) != 0) { - _DebugMessage(0, "Different storage group - switching back to parent\n", state); + _ DebugMessage(100, "Different storage group - switching back to parent\n", state); saved_log_path = new WCHAR[wcslen(restore_environment->m_wszRestoreLogPath) + 1]; wcscpy(saved_log_path, restore_environment->m_wszRestoreLogPath); _DebugMessage(100, "Calling HrESERestoreSaveEnvironment\n"); @@ -339,7 +339,7 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_ } if (saved_log_path != NULL) { - _DebugMessage(0, "Calling HrESERestoreReopen\n"); + _ DebugMessage(100, "Calling HrESERestoreReopen\n"); result = HrESERestoreReopen(context->computer_name, service_name, saved_log_path, &hccx); if (result != 0) { @@ -349,7 +349,7 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_ rp->create_status = CF_CREATED; return bRC_OK; } - _DebugMessage(0, "Calling HrESERestoreGetEnvironment\n"); + _ DebugMessage(100, "Calling HrESERestoreGetEnvironment\n"); result = HrESERestoreGetEnvironment(hccx, &restore_environment); if (result != 0) { @@ -377,7 +377,7 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_ storage_group_name = new WCHAR[strlen(name) + 1]; mbstowcs(service_name, parent->name, strlen(parent->name) + 1); mbstowcs(storage_group_name, name, strlen(name) + 1); - _DebugMessage(0, "Calling HrESERestoreOpen\n"); + _ DebugMessage(100, "Calling HrESERestoreOpen\n"); result = HrESERestoreOpen(context->computer_name, service_name, storage_group_name, NULL, &hccx); if (result != 0) { @@ -385,7 +385,7 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_ state = 999; break; } - _DebugMessage(0, "Calling HrESERestoreGetEnvironment\n"); + _ DebugMessage(100, "Calling HrESERestoreGetEnvironment\n"); result = HrESERestoreGetEnvironment(hccx, &restore_environment); if (result != 0) { @@ -490,7 +490,7 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_ bRC storage_group_node_t::endRestoreFile(exchange_fd_context_t *context) { - _DebugMessage(0, "endRestoreFile_STORAGE_GROUP state = %d\n", state); + _ DebugMessage(100, "endRestoreFile_STORAGE_GROUP state = %d\n", state); switch (state) { case 0: diff --git a/bacula/src/win32/filed/plugins/store_node.c b/bacula/src/win32/filed/plugins/store_node.c index 81b10b08de..0d953a43ea 100644 --- a/bacula/src/win32/filed/plugins/store_node.c +++ b/bacula/src/win32/filed/plugins/store_node.c @@ -131,11 +131,11 @@ store_node_t::endBackupFile(exchange_fd_context_t *context) bRC store_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) { - _DebugMessage(0, "createFile_STORE state = %d\n", state); + _ DebugMessage(100, "createFile_STORE state = %d\n", state); if (strcmp(context->path_bits[level - 1], parent->name) != 0) { - _DebugMessage(0, "Different storage group - switching back to parent\n", state); + _ DebugMessage(100, "Different storage group - switching back to parent\n", state); context->current_node = parent; return bRC_OK; } @@ -190,7 +190,7 @@ store_node_t::createFile(exchange_fd_context_t *context, struct restore_pkt *rp) case 999: if (strcmp(context->path_bits[level], name) != 0) { - _DebugMessage(0, "End of Store when in error state - switching back to parent\n", state); + _ DebugMessage(100, "End of Store when in error state - switching back to parent\n", state); context->current_node = parent; return bRC_OK; } @@ -205,14 +205,14 @@ store_node_t::endRestoreFile(exchange_fd_context_t *context) { HRESULT result; - _DebugMessage(0, "endRestoreFile_STORE state = %d\n", state); + _ DebugMessage(100, "endRestoreFile_STORE state = %d\n", state); for (;;) { switch (state) { case 0: state = 1; - _DebugMessage(0, "Calling HrESERestoreAddDatabase\n"); + _ DebugMessage(100, "Calling HrESERestoreAddDatabase\n"); result = HrESERestoreAddDatabase(hccx, dbi_node->restore_display_name, dbi_node->restore_guid, dbi_node->restore_input_streams, &dbi_node->restore_output_streams); if (result != 0) {