You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/12/30 22:28:00 UTC
[jira] [Commented] (LOG4J2-3267) Getting public access to org.apache.logging.log4j.core.tools.Generate#generate method for automated code generation
[ https://issues.apache.org/jira/browse/LOG4J2-3267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467008#comment-17467008 ]
ASF subversion and git services commented on LOG4J2-3267:
---------------------------------------------------------
Commit 75391dfc7c620bd69ebe804a4eddb2cd7d0f4d0d in logging-log4j2's branch refs/heads/release-2.x from Remko Popma
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=75391df ]
[LOG4J2-3267] make Generate#generate method public for automation
> Getting public access to org.apache.logging.log4j.core.tools.Generate#generate method for automated code generation
> -------------------------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-3267
> URL: https://issues.apache.org/jira/browse/LOG4J2-3267
> Project: Log4j 2
> Issue Type: Wish
> Components: Core
> Affects Versions: 2.17.0
> Reporter: Gotthard Witsch
> Assignee: Remko Popma
> Priority: Trivial
>
> Hi devs,
> I'd like to automate the creation of a custom logger with gradle.
> Sticking to the documentation i've tried to use org.apache.logging.log4j.core.tools.ExtendedLoggerGenerator as mentioned in [Log4j – Custom Log Levels (apache.org)|https://logging.apache.org/log4j/2.x/manual/customloglevels.html#CustomLoggers]
> Unfortunately the output can only be consumed from console, making it very hard for automation.
> Investigating the implemenation led me to org.apache.logging.log4j.core.tools.Generate.generate.
> Unfortunately the required method is package private.
> Therefore it would be helpful to change the generate-method's visibility to public to gain access in gradle scripts.
> {code:java}
> static void generate(final String[] args, final Type type, final PrintStream printStream) {code}
> Is there any chance of changing this? Or what was the intention to keep it package-private?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)