-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #678 from eclipse-passage/572145
Bug 572145 - [Passage][Floating] extend logging
- Loading branch information
Showing
9 changed files
with
91 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ output.. = bin/ | |
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/,\ | ||
about.html | ||
about.html,\ | ||
config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...g.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/logging/Logging.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.base.logging; | ||
|
||
import java.io.FileInputStream; | ||
import java.nio.file.Path; | ||
|
||
import org.apache.logging.log4j.core.config.ConfigurationSource; | ||
import org.apache.logging.log4j.core.config.Configurator; | ||
|
||
public final class Logging { | ||
|
||
private final ConfigSupplier config; | ||
|
||
public Logging(ConfigSupplier config) { | ||
this.config = config; | ||
} | ||
|
||
@SuppressWarnings("resource") | ||
public void configure() { | ||
try { | ||
ConfigurationSource source = new ConfigurationSource(new FileInputStream(config.get().toFile())); | ||
Configurator.initialize(getClass().getClassLoader().getParent(), source); | ||
} catch (Exception e) { | ||
System.err.println("Failed to configure logging"); //$NON-NLS-1$ | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
public static interface ConfigSupplier { | ||
|
||
Path get() throws Exception; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters