Skip to content

CustomLog annotation for Selcukes logger

Ramesh Babu Prudhvi edited this page Aug 11, 2021 · 3 revisions
  • Add Lombok dependency to pom.xml
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>LATEST</version>
            <scope>provided</scope>
        </dependency>
  • Create lombok.config in project parent folder and add below properties
lombok.log.fieldName = logger
lombok.log.custom.declaration = io.github.selcukes.commons.logging.Logger io.github.selcukes.commons.logging.LoggerFactory.getLogger(TYPE)

Usage

package io.github.selcukes.java;

import lombok.CustomLog;
import org.testng.annotations.Test;

@CustomLog
public class LoggerTest {
    @Test
    public void testLogs() {
        logger.info(() -> "This is sample log");
    }
}
Clone this wiki locally