public void logger_log(LogType type, String source, String message) {
   writeInt(ClientCommand.logger_log.ordinal());
   writeInt(type.ordinal());
   writeString(source);
   writeString(message);
   flush();
 }
Esempio n. 2
0
 public static void log(String message, LogType logType) {
   try {
     String folderPath =
         Utils.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
     if (new File(folderPath).isDirectory())
       folderPath = folderPath.substring(0, folderPath.length() - 1);
     String logFile =
         folderPath.substring(0, folderPath.lastIndexOf("/") + 1) + "verification.log";
     // System.err.println("INFO: updated log file " + logFile);
     String callerClassName = new Exception().getStackTrace()[1].getClassName();
     IOUtils.writeFile(
         ("\n" + logType.toString() + " " + getUTCTime() + " " + callerClassName + " \n" + message)
             .getBytes(),
         logFile,
         true);
   } catch (Exception ex) {
     ex.printStackTrace();
   }
 }
Esempio n. 3
0
 /**
  * 描述:设置日志类型
  *
  * @author lurf
  * @param logType
  * @return
  */
 public LogHelper setLogType(LogType logType) {
   MDC.put(logTypeKey, logType.value());
   return this;
 }
 /**
  * You can set this optional parameter to "Tail" in the request only if you specify the <code>
  * InvocationType</code> parameter with value "RequestResponse". In this case, AWS Lambda returns
  * the base64-encoded last 4 KB of log data produced by your Lambda function in the <code>
  * x-amz-log-results</code> header.
  *
  * <p>Returns a reference to this object so that method calls can be chained together.
  *
  * <p><b>Constraints:</b><br>
  * <b>Allowed Values: </b>None, Tail
  *
  * @param logType You can set this optional parameter to "Tail" in the request only if you specify
  *     the <code>InvocationType</code> parameter with value "RequestResponse". In this case, AWS
  *     Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in
  *     the <code>x-amz-log-results</code> header.
  * @return A reference to this updated object so that method calls can be chained together.
  * @see LogType
  */
 public InvokeRequest withLogType(LogType logType) {
   this.logType = logType.toString();
   return this;
 }
 /**
  * You can set this optional parameter to "Tail" in the request only if you specify the <code>
  * InvocationType</code> parameter with value "RequestResponse". In this case, AWS Lambda returns
  * the base64-encoded last 4 KB of log data produced by your Lambda function in the <code>
  * x-amz-log-results</code> header.
  *
  * <p><b>Constraints:</b><br>
  * <b>Allowed Values: </b>None, Tail
  *
  * @param logType You can set this optional parameter to "Tail" in the request only if you specify
  *     the <code>InvocationType</code> parameter with value "RequestResponse". In this case, AWS
  *     Lambda returns the base64-encoded last 4 KB of log data produced by your Lambda function in
  *     the <code>x-amz-log-results</code> header.
  * @see LogType
  */
 public void setLogType(LogType logType) {
   this.logType = logType.toString();
 }