Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,17 @@ public Integer convert(final String s) {
}

/**
* Converts a {@link String} into a Log4j {@link Level}. Returns {@code null} for invalid level names.
* Converts a {@link String} into a Log4j {@link Level}.
*/
@Plugin(name = "Level", category = CATEGORY)
public static class LevelConverter implements TypeConverter<Level> {
/**
* {@inheritDoc}
* @param s the string to convert
* @return the resolved level
* @throws NullPointerException if the given value is {@code null}.
* @throws IllegalArgumentException if the given argument is not resolvable to a level
*/
@Override
public Level convert(final String s) {
return Level.valueOf(s);
Expand Down
10 changes: 10 additions & 0 deletions src/changelog/.2.x.x/3359_fix-javadoc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="fixed">
<issue id="3359" link="https://github.com/apache/logging-log4j2/issues/3359"/>
<description format="asciidoc">
TypeConverters convert for "Level" incorrectly documented behaviour for invalid value - updated javadoc.
</description>
</entry>
Loading