Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOXIA-534] Migrate logging to slf4j and deprecate doxia-logging-api #8

Closed

Conversation

slachiewicz
Copy link
Member

New version that deprecates doxia-logging

Deprecate doxia-logging-api based on plexus and implement logging based on slf4j. 
more log updates
Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm taking a look at this project. Is this PR still in process?


protected Logger logger = LoggerFactory.getLogger( getClass() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final?

@@ -151,6 +153,7 @@ public void executeMacro( String macroId, MacroRequest request, Sink sink )
* @return The base directory.
* @deprecated this does not work in multi-module builds, see DOXIA-373
*/
@Deprecated
protected File getBasedir()
{
// TODO: This is baaad, it should come in with the request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete now irrelevant todo

@@ -58,18 +60,24 @@
/** lazy xmlReader to validate xml content*/
private XMLReader xmlReader;

private Log logger;
private static final Logger LOGGER = LoggerFactory.getLogger( XmlValidator.class );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger since it's not really a constant value

@@ -161,13 +164,12 @@ private Log getLog()
private static final Pattern ELEMENT_TYPE_PATTERN =
Pattern.compile( "Element type \".*\" must be declared.", Pattern.DOTALL );

private final Log log;
private final Logger log = LoggerFactory.getLogger( MessagesErrorHandler.class );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static?
logger?

protected static String normalizeLineEnds(String s) {
if ( s != null) {
return s.replace("\r\n", "\n" );
// .replace('\r', '\n');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no commented code please

* Wrap a Slf4j logger into a Doxia logger.
*
* @since 1.7
* @deprecated use directly slf4j
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slf4j directly


public void debug( CharSequence content )
{
if ( logger.isDebugEnabled() )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use braces in multiline ifs

@slachiewicz slachiewicz closed this Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants