// Path: src/main/java/com/stackify/api/LogMsg.java
// @AllArgsConstructor
// @NoArgsConstructor
// @Builder(builderClassName = "Builder", builderMethodName = "newBuilder", toBuilder = true)
// @Data
// @JsonInclude(JsonInclude.Include.NON_NULL)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class LogMsg {
// 
//     /**
//      * The log message
//      */
//     @Setter
//     @JsonProperty("Msg")
//     private String msg;
// 
//     /**
//      * Extra contextual data from the log message
//      */
//     @Setter
//     @JsonProperty("data")
//     private String data;
// 
//     /**
//      * The error/exception details
//      */
//     @JsonProperty("Ex")
//     private StackifyError ex;
// 
//     /**
//      * The thread name
//      */
//     @JsonProperty("Th")
//     private String th;
// 
//     /**
//      * Unix timestamp of the log message
//      */
//     @JsonProperty("EpochMs")
//     private Long epochMs;
// 
//     /**
//      * Log level of the message
//      */
//     @JsonProperty("Level")
//     private String level;
// 
//     /**
//      * Transaction id
//      */
//     @JsonProperty("TransID")
//     private String transId;
// 
//     /**
//      * Source method name
//      */
//     @JsonProperty("SrcMethod")
//     private String srcMethod;
// 
//     /**
//      * Source line number
//      */
//     @JsonProperty("SrcLine")
//     private Integer srcLine;
// 
//     /**
//      * The log message id
//      */
//     @lombok.Builder.Default
//     @JsonProperty("id")
//     private String id = UUID.randomUUID().toString();
// 
//     /**
//      * List of Tags
//      */
//     @JsonProperty("Tags")
//     private List<String> tags;
// 
// 
// }
// 
// Path: src/main/java/com/stackify/api/StackifyError.java
// @AllArgsConstructor
// @NoArgsConstructor
// @Builder(builderClassName = "Builder", builderMethodName = "newBuilder", toBuilder = true)
// @Data
// @JsonInclude(JsonInclude.Include.NON_NULL)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class StackifyError {
// 
//     /**
//      * Environment
//      */
//     @JsonProperty("EnvironmentDetail")
//     private EnvironmentDetail environmentDetail;
// 
//     /**
//      * Date/time of the error
//      */
//     @JsonProperty("OccurredEpochMillis")
//     private Long occurredEpochMillis;
// 
//     /**
//      * Error details
//      */
//     @JsonProperty("Error")
//     private ErrorItem error;
// 
//     /**
//      * Details of the web request
//      */
//     @JsonProperty("WebRequestDetail")
//     private WebRequestDetail webRequestDetail;
// 
//     /**
//      * Server variables
//      */
//     @JsonProperty("ServerVariables")
//     private Map<String, String> serverVariables;
// 
//     /**
//      * Customer name
//      */
//     @JsonProperty("CustomerName")
//     private String customerName;
// 
//     /**
//      * User name
//      */
//     @JsonProperty("UserName")
//     private String userName;
// 
// }


import com.stackify.api.LogMsg;
import com.stackify.api.StackifyError;
/*
 * Copyright 2014 Stackify
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.stackify.api.common.log;


/**
 * EventAdapter
 * @author Eric Martin
 */
public interface EventAdapter<T> {

	/**
	 * Gets the Throwable (optional) from the logging event
	 * @param event The logging event
	 * @return The Throwable (optional)
	 */
	Throwable getThrowable(final T event);

	/**
	 * Builds a StackifyError from the logging event
	 * @param event The logging event
	 * @param exception The exception
	 * @return The StackifyError
	 */
	StackifyError getStackifyError(final T event, final Throwable exception);

	/**
	 * Builds a LogMsg from the logging event
	 * @param event The logging event
	 * @param error The exception (optional)
	 * @return The LogMsg
	 */
// Path: src/main/java/com/stackify/api/LogMsg.java
// @AllArgsConstructor
// @NoArgsConstructor
// @Builder(builderClassName = "Builder", builderMethodName = "newBuilder", toBuilder = true)
// @Data
// @JsonInclude(JsonInclude.Include.NON_NULL)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class LogMsg {
// 
//     /**
//      * The log message
//      */
//     @Setter
//     @JsonProperty("Msg")
//     private String msg;
// 
//     /**
//      * Extra contextual data from the log message
//      */
//     @Setter
//     @JsonProperty("data")
//     private String data;
// 
//     /**
//      * The error/exception details
//      */
//     @JsonProperty("Ex")
//     private StackifyError ex;
// 
//     /**
//      * The thread name
//      */
//     @JsonProperty("Th")
//     private String th;
// 
//     /**
//      * Unix timestamp of the log message
//      */
//     @JsonProperty("EpochMs")
//     private Long epochMs;
// 
//     /**
//      * Log level of the message
//      */
//     @JsonProperty("Level")
//     private String level;
// 
//     /**
//      * Transaction id
//      */
//     @JsonProperty("TransID")
//     private String transId;
// 
//     /**
//      * Source method name
//      */
//     @JsonProperty("SrcMethod")
//     private String srcMethod;
// 
//     /**
//      * Source line number
//      */
//     @JsonProperty("SrcLine")
//     private Integer srcLine;
// 
//     /**
//      * The log message id
//      */
//     @lombok.Builder.Default
//     @JsonProperty("id")
//     private String id = UUID.randomUUID().toString();
// 
//     /**
//      * List of Tags
//      */
//     @JsonProperty("Tags")
//     private List<String> tags;
// 
// 
// }
// 
// Path: src/main/java/com/stackify/api/StackifyError.java
// @AllArgsConstructor
// @NoArgsConstructor
// @Builder(builderClassName = "Builder", builderMethodName = "newBuilder", toBuilder = true)
// @Data
// @JsonInclude(JsonInclude.Include.NON_NULL)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class StackifyError {
// 
//     /**
//      * Environment
//      */
//     @JsonProperty("EnvironmentDetail")
//     private EnvironmentDetail environmentDetail;
// 
//     /**
//      * Date/time of the error
//      */
//     @JsonProperty("OccurredEpochMillis")
//     private Long occurredEpochMillis;
// 
//     /**
//      * Error details
//      */
//     @JsonProperty("Error")
//     private ErrorItem error;
// 
//     /**
//      * Details of the web request
//      */
//     @JsonProperty("WebRequestDetail")
//     private WebRequestDetail webRequestDetail;
// 
//     /**
//      * Server variables
//      */
//     @JsonProperty("ServerVariables")
//     private Map<String, String> serverVariables;
// 
//     /**
//      * Customer name
//      */
//     @JsonProperty("CustomerName")
//     private String customerName;
// 
//     /**
//      * User name
//      */
//     @JsonProperty("UserName")
//     private String userName;
// 
// }


// Path: src/main/java/com/stackify/api/common/log/EventAdapter.java
import com.stackify.api.LogMsg;
import com.stackify.api.StackifyError;

/*
 * Copyright 2014 Stackify
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.stackify.api.common.log;


/**
 * EventAdapter
 * @author Eric Martin
 */
public interface EventAdapter<T> {

	/**
	 * Gets the Throwable (optional) from the logging event
	 * @param event The logging event
	 * @return The Throwable (optional)
	 */
	Throwable getThrowable(final T event);

	/**
	 * Builds a StackifyError from the logging event
	 * @param event The logging event
	 * @param exception The exception
	 * @return The StackifyError
	 */
	StackifyError getStackifyError(final T event, final Throwable exception);

	/**
	 * Builds a LogMsg from the logging event
	 * @param event The logging event
	 * @param error The exception (optional)
	 * @return The LogMsg
	 */
	LogMsg getLogMsg(final T event, final StackifyError error);	