Moti Asayag has posted comments on this change. Change subject: core: added missing logging + refactoring ......................................................................
Patch Set 1: (4 comments) http://gerrit.ovirt.org/#/c/29244/1/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java: Line 116: ull) { this condition is no longer valid. there will always be a severity to audit log type. this if statement should be removed. Line 121: Line 122: if (auditLog == null) { Line 123: log.warn("Unable to create AuditLog"); Line 124: } else { Line 125: auditLog.setstorage_domain_id(auditLogable.getStorageDomainId()); this could also be extracted into a method. Line 126: auditLog.setstorage_domain_name(auditLogable.getStorageDomainName()); Line 127: auditLog.setstorage_pool_id(auditLogable.getStoragePoolId()); Line 128: auditLog.setstorage_pool_name(auditLogable.getStoragePoolName()); Line 129: auditLog.setvds_group_id(auditLogable.getVdsGroupId()); Line 143: logMessage(severity, getMessageToLog(loggerString, auditLog)); Line 144: } Line 145: } Line 146: Line 147: private static void logMessage(AuditLogSeverity severity, String logMessage) { since it resides on the common project, i don't think it is doable (as it required gwt support to compile). Line 148: //TODO MM: rather than this, there could(should?) be OO approach: introducing 'log' method on AuditLogSeverity. Line 149: switch (severity) { Line 150: case NORMAL: Line 151: log.info(logMessage); Line 191: auditLogable.getEventFloodInSec(), Line 192: auditLogable.getCustomData()); Line 193: } Line 194: Line 195: final String messageByType = messages.get(logType); i'd enforce this as part of the build (via unit test) so any entry in AduitLogType has a matching message in AuditLogMessage.properties Line 196: if (messageByType == null) { Line 197: return null; Line 198: } else { Line 199: // Application log message from AuditLogMessages -- To view, visit http://gerrit.ovirt.org/29244 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic737ace1808e1f242d0eb08ee458869a89be500e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches