CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-projectlombok--lombok

Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again, with one annotation your class has a fully featured builder, automate your logging variables, and much more.

Pending
Overview
Eval results
Files

logging.mddocs/

Logging

Seamless integration with popular Java logging frameworks through automatic logger field generation.

Capabilities

SLF4J Integration

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface Slf4j {
    String topic() default "";
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface XSlf4j {
    String topic() default "";
}

Log4j Integration

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface Log4j {
    String topic() default "";
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface Log4j2 {
    String topic() default "";
}

Other Logging Frameworks

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface Log {  // Java Util Logging
    String topic() default "";
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface CommonsLog {  // Apache Commons Logging
    String topic() default "";
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface JBossLog {  // JBoss Logging
    String topic() default "";
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface Flogger {  // Google Flogger
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface CustomLog {
    String topic() default "";
}

Usage Examples:

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class UserService {
    public void createUser(String name) {
        log.info("Creating user: {}", name);
        // Implementation
        log.debug("User created successfully");
    }
}

// Generated field:
// private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(UserService.class);

Log4j2 Example:

import lombok.extern.log4j.Log4j2;

@Log4j2
public class PaymentProcessor {
    public void processPayment(double amount) {
        log.info("Processing payment of ${}", amount);
        try {
            // Payment processing logic
            log.debug("Payment processed successfully");
        } catch (Exception e) {
            log.error("Payment processing failed", e);
        }
    }
}

// Generated field:
// private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(PaymentProcessor.class);

Java Util Logging Example:

import lombok.extern.java.Log;

@Log
public class FileManager {
    public void saveFile(String filename) {
        log.info("Saving file: " + filename);
        // Implementation
        log.fine("File saved successfully");
    }
}

// Generated field:
// private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(FileManager.class.getName());

Custom Topic Example:

import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "AUDIT")
public class AuditService {  
    public void auditAction(String action) {
        log.info("Audit: {}", action);
    }
}

// Generated field:
// private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("AUDIT");

Install with Tessl CLI

npx tessl i tessl/maven-org-projectlombok--lombok

docs

builder-pattern.md

constructors.md

data-classes.md

experimental.md

immutable-patterns.md

index.md

logging.md

object-methods.md

property-access.md

type-inference.md

utilities.md

tile.json