Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: edd4d5c1396a461dc5730fda6b36f8408dc5d6ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c) 2011 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.equinox.internal.p2.director.app;

import org.eclipse.core.runtime.IStatus;

/**
 * Manages all outputs of the director application: logs to a file as well as the standard streams
 * <p>
 * This indirection is needed in order to manage the outputs when the director is called from ant, where
 * the standard streams are handled differently.
 */
public interface ILog {
	/**
	 * Send status to the standard log
	 * 
	 * @param status
	 */
	void log(IStatus status);

	/**
	 * 
	 * @param message
	 * @deprecated Use {@link ILog#printOut()} or {@link ILog#printErr()}
	 */
	@Deprecated
	default void log(String message) {
		printOut(message);
	}

	/**
	 * Notify that logging is completed & cleanup resources
	 */
	void close();

	/**
	 * Print status on stdout or stderr.
	 * 
	 * By default calls {@link #log}
	 * 
	 * @param status
	 */
	default void printOut(String line) {
		System.out.println(line);
	}

	/**
	 * Send line to stdout
	 * 
	 * By default does nothing
	 * 
	 * @param message line
	 */
	default void printErr(String line) {
		System.err.println(line);
	}
}

Back to the top