Skip to content

Instantly share code, notes, and snippets.

public boolean transform(String outputDir, String timbermillParentId) throws InterruptedException {
String id = TimberLogger.start("transform", timbermillParentId, LogParams.create().text("outputhDir", outputDir));
boolean isAuthorized = authorized(id);
runTransformation();
boolean isSuccess = persistToDisk(outputDir);
TimberLogger.success();
return isSuccess;
}
public List<String> query(String query, String timbermillParentId) {
String id = TimberLogger.start("query", timbermillParentId, LogParams.create().text("sql", query));
try {
authorized(id);
List<String> list = runSql(query);
TimberLogger.success();
return list;
} catch (Throwable t){
public List<String> query(String query, String timbermillParentId) throws InterruptedException {
String id = TimberLogger.start("query", timbermillParentId, LogParams.create().text("sql", query));
try {
authorized(id);
List<String> list = runSql(query);
TimberLogger.success();
return list;
} catch (Throwable t){
public List<String> query(String query, String timbermillParentId) throws InterruptedException {
String id = TimberLogger.start("query", timbermillParentId, LogParams.create().text("sql", query));
try {
authorized(id);
List<String> list = runSql(query);
TimberLogger.success();
return list;
} catch (Throwable t){
@TimberLog(name = "etl_invocation")
public boolean runEtl(String userId, String outputDir) {
TimberLogger.logContext("userId", userId);
String timbermillId = TimberLogger.getCurrentTaskId();
List<String> result = callQueryService(timbermillId);
boolean isSuccess = callTransformationService(timbermillId, result, outputDir);
return isSuccess;
}
@TimberLog(name = "etl_invocation")
public boolean runEtl(String userId, String outputDir) {
TimberLogger.logContext("userId", userId);
String timbermillId = TimberLogger.getCurrentTaskId();
List<String> result = callQueryService(timbermillId);
boolean isSuccess = callTransformationService(timbermillId, result, outputDir);
return isSuccess;
}
@TimberLog(name = "etl_invocation")
public boolean runEtl(String userId, String outputDir) {
TimberLogger.logContext("userId", userId);
String timbermillId = TimberLogger.getCurrentTaskId();
List<String> result = callQueryService(timbermillId);
boolean isSuccess = callTransformationService(timbermillId, result, outputDir);
return isSuccess;
}
TimberLogger.exit();
public void doSomething(){
TimberLogger.logContext("key","context");
TimberLogger.logText("key","This is a text");
TimberLogger.logString("key","string");
TimberLogger.logMetric("key",2);
TimberLogger.logInfo("This is a regular log");
TimberLogger.logInfo("This is also a regular log");
}
@TimberLog(name = "method_to_log")
public static void methodToLog(){
doSomething()
}