[
https://issues.apache.org/jira/browse/LOG4J2-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17910080#comment-17910080
]
Jeff Thomas commented on LOG4J2-3694:
-------------------------------------
[~pkarwasz] - Facepalm... sorrry just went with my browser history and ended up
here instead of Github and didn't think about it... will do..thanks (same for
the others)
> Javadoc: TypeConverters convert for "Level" incorrectly documents behaviour
> for invalid value
> ---------------------------------------------------------------------------------------------
>
> Key: LOG4J2-3694
> URL: https://issues.apache.org/jira/browse/LOG4J2-3694
> Project: Log4j 2
> Issue Type: Bug
> Components: API, Configuration
> Affects Versions: 2.24.0
> Reporter: Jeff Thomas
> Priority: Trivial
> Labels: newbie
>
> Minor Javadoc correction.
> In TypeConverters, the conversion for type "Level" says it returns 'null' for
> invalid levels:
> {code:java}
> /**
> * Converts a {@link String} into a Log4j {@link Level}. Returns {@code null}
> for invalid level names.
> */
> @Plugin(name = "Level", category = CATEGORY)
> public static class LevelConverter implements TypeConverter<Level> {
> @Override
> public Level convert(final String s) {
> return Level.valueOf(s);
> }
> } {code}
> But {{Level.valueOf(s)}} throws an IllegalArgumentException for unknown
> levels.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)