Skip to content

Commit

Permalink
Fix Wrong/Missing Log Levels in application.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Nov 4, 2020
1 parent ab86a54 commit 7254aa6
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 438 deletions.
7 changes: 7 additions & 0 deletions microprofile.jdt/org.eclipse.lsp4mp.jdt.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
<provider class="org.eclipse.lsp4mp.jdt.internal.core.providers.MicroProfileProjectLabelProvider" />
</extension>

<!-- Java Util Logging Config support -->

<extension point="org.eclipse.lsp4mp.jdt.core.propertiesProviders">
<!-- Hints provider for java.util.logging.Level -->
<provider class="org.eclipse.lsp4mp.jdt.internal.jul.properties.JULPropertyProvider" />
</extension>

<!-- Microprofile Config support -->

<extension point="org.eclipse.lsp4mp.jdt.core.propertiesProviders">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ public ItemHint getItemHint(String hint) {
@Override
public void merge(ConfigurationMetadata metadata, MergingStrategy mergingStrategy) {
List<ItemMetadata> properties = metadata.getProperties();
if (properties == null) {
return;
}
for (ItemMetadata property: properties) {
merge(property, mergingStrategy);
}
if (properties != null) {
for (ItemMetadata property: properties) {
merge(property, mergingStrategy);
}
}
List<ItemHint> hints = metadata.getHints();
if (hints != null) {
for (ItemHint itemHint : hints) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2019 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.lsp4mp.jdt.internal.jul.properties;

import java.util.logging.Level;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.lsp4mp.jdt.core.AbstractStaticPropertiesProvider;
import org.eclipse.lsp4mp.jdt.core.MicroProfileCorePlugin;
import org.eclipse.lsp4mp.jdt.core.SearchContext;

/**
* Java Util Logging properties provider for {@link Level}.
*
* @author Angelo ZERR
*
*/
public class JULPropertyProvider extends AbstractStaticPropertiesProvider {

public JULPropertyProvider() {
super(MicroProfileCorePlugin.PLUGIN_ID, "/static-properties/jul-metadata.json");
}

@Override
protected boolean isAdaptedFor(SearchContext context, IProgressMonitor monitor) {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"hints": [
{
"name": "java.util.logging.Level",
"sourceType": "java.util.logging.Level",
"values": [
{
"value": "OFF",
"description": "`OFF` is a special level that can be used to turn off logging.\nThis level is initialized to `Integer.MAX_VALUE`."
},
{
"value": "SEVERE",
"description": "`SEVERE` is a message level indicating a serious failure.\n\nIn general SEVERE messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators. This level is initialized to `1000`."
},
{
"value": "WARNING",
"description": "`WARNING` is a message level indicating a potential problem.\n\nIn general WARNING messages should describe events that will be of interest to end users or system managers, or which indicate potential problems. This level is initialized to `900`."
},
{
"value": "INFO",
"description": "`INFO` is a message level for informational messages.\n\nTypically INFO messages will be written to the console or its equivalent. So the INFO level should only be used for reasonably significant messages that will make sense to end users and system administrators. This level is initialized to `800`."
},
{
"value": "CONFIG",
"description": "`CONFIG` is a message level for static configuration messages.\n\nCONFIG messages are intended to provide a variety of static configuration information, to assist in debugging problems that may be associated with particular configurations. For example, CONFIG message might include the CPU type, the graphics depth, the GUI look-and-feel, etc. This level is initialized to `700`."
},
{
"value": "FINE",
"description": "`FINE` is a message level providing tracing information.\n\nAll of FINE, FINER, and FINEST are intended for relatively detailed tracing. The exact meaning of the three levels will vary between subsystems, but in general, FINEST should be used for the most voluminous detailed output, FINER for somewhat less detailed output, and FINE for the lowest volume (and most important) messages.\n\nIn general the FINE level should be used for information that will be broadly interesting to developers who do not have a specialized interest in the specific subsystem.\n\nFINE messages might include things like minor (recoverable) failures. Issues indicating potential performance problems are also worth logging as FINE. This level is initialized to `500`."
},
{
"value": "FINER",
"description": "`FINER` indicates a fairly detailed tracing message. By default logging calls for entering, returning, or throwing an exception are traced at this level. This level is initialized to `400`."
},
{
"value": "FINEST",
"description": "`FINEST` indicates a highly detailed tracing message. This level is initialized to `300`."
},
{
"value": "ALL",
"description": "`ALL` indicates that all messages should be logged. This level is initialized to `Integer.MIN_VALUE`."
}
]
}
]
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7254aa6

Please sign in to comment.