Skip to content

Package: LogConsumer

LogConsumer

nameinstructionbranchcomplexitylinemethod
LogConsumer()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
reported(AbstractReport)
M: 0 C: 9
100%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Edgar Mueller - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.model.internal.reporting;
15:
16: import org.eclipse.core.runtime.IStatus;
17: import org.eclipse.emf.ecp.view.spi.model.impl.Activator;
18: import org.eclipse.emf.ecp.view.spi.model.util.ViewModelUtil;
19: import org.eclipse.emfforms.spi.common.report.AbstractReport;
20: import org.eclipse.emfforms.spi.common.report.ReportServiceConsumer;
21:
22: /**
23: * A {@link ReportServiceConsumer} that logs all all received {@code ReportEntities}.
24: *
25: * @author emueller
26: */
27: public class LogConsumer implements ReportServiceConsumer {
28:
29:         /**
30:          *
31:          * {@inheritDoc}
32:          *
33:          * @see org.eclipse.emfforms.spi.common.report.ReportServiceConsumer#reported(org.eclipse.emfforms.spi.common.report.AbstractReport)
34:          */
35:         @Override
36:         public void reported(AbstractReport reportEntity) {
37:•                if (reportEntity.getSeverity() > IStatus.INFO || ViewModelUtil.isDebugMode()) {
38:                         Activator.log(reportEntity);
39:                 }
40:         }
41:
42: }