crwdns151907:0crwdne151907:0

crwdns151909:0crwdne151909:0

  • crwdns151911:0crwdne151911:0

  • crwdns151913:0crwdne151913:0

  • crwdns151915:0crwdne151915:0

crwdns151917:0crwdne151917:0

crwdns151919:0crwdne151919:0

crwdns151921:0crwdne151921:0

Note

crwdns151923:0:doc:crwdne151923:0

crwdns151925:0crwdne151925:0

import com.google.inject.Inject;
import org.slf4j.Logger;

@Inject
private Logger logger;

crwdns151927:0crwdne151927:0

private Logger logger;

@Inject
private void setLogger(Logger logger) {
    this.logger = logger;
}

crwdns151929:0crwdne151929:0

// For the purpose of this example, "Banana" is the class name

private Logger logger;

@Inject
public Banana(Logger logger) {
    this.logger = logger;
}

crwdns151931:0crwdne151931:0

crwdns151933:0crwdne151933:0

public Logger getLogger() {
    return logger;
}

crwdns151935:0crwdne151935:0

crwdns151937:0crwdne151937:0

Note

crwdns151939:0crwdne151939:0

getLogger().info(String);
getLogger().debug(String);
getLogger().warn(String);
getLogger().error(String);

crwdns151941:0crwdne151941:0

getLogger().warn("This is a warning!");