View Javadoc
1   package net.avcompris.commons3.utils;
2   
3   import static org.joda.time.DateTimeZone.UTC;
4   
5   import javax.annotation.Nullable;
6   
7   import org.joda.time.DateTime;
8   
9   public abstract class LogUtils {
10  
11  	public static String format( //
12  			@Nullable final String correlationId, //
13  			@Nullable final Level level, //
14  			@Nullable final String message) {
15  
16  		final DateTime now = new DateTime().withZone(UTC);
17  
18  		return now //
19  				+ " " + (level == null ? null : level.paddedLabel()) //
20  				+ " [" + correlationId + "] " //
21  				+ message;
22  	}
23  }