ch.qos.logback.core.Layout.getFileHeader()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中ch.qos.logback.core.Layout.getFileHeader()方法的一些代码示例,展示了Layout.getFileHeader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Layout.getFileHeader()方法的具体详情如下:
包路径:ch.qos.logback.core.Layout
类名称:Layout
方法名:getFileHeader

Layout.getFileHeader介绍

[英]Return the file header for this layout. The returned value may be null.
[中]返回此布局的文件头。返回的值可能为空。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

void writeHeader() throws IOException {
 if (layout != null && (outputStream != null)) {
  StringBuilder sb = new StringBuilder();
  appendIfNotNull(sb, layout.getFileHeader());
  appendIfNotNull(sb, layout.getPresentationHeader());
  if (sb.length() > 0) {
   sb.append(CoreConstants.LINE_SEPARATOR);
   // If at least one of file header or presentation header were not
   // null, then append a line separator.
   // This should be useful in most cases and should not hurt.
   outputStream.write(convertToBytes(sb.toString()));
   outputStream.flush();
  }
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

String header = layout.getFileHeader();
if (header != null) {
 sbuf.append(header);

代码示例来源:origin: ch.qos.logback/logback-examples

@Override
public void start() {
  if (this.layout == null) {
    addError("No layout set for the appender named [" + name + "].");
    return;
  }
  String header = layout.getFileHeader();
  System.out.print(header);
  super.start();
}

代码示例来源:origin: ch.qos.logback/logback-examples

@Override
public void start() {
  if (this.layout == null) {
    addError("No layout set for the appender named [" + name + "].");
    return;
  }
  String header = layout.getFileHeader();
  System.out.println(header);
  super.start();
}

代码示例来源:origin: ch.qos.logback/core

void writeHeader() throws IOException {
 if (layout != null && (outputStream != null)) {
  StringBuilder sb = new StringBuilder();
  appendIfNotNull(sb, layout.getFileHeader());
  appendIfNotNull(sb, layout.getPresentationHeader());
  if (sb.length() > 0) {
   sb.append(CoreConstants.LINE_SEPARATOR);
   // If at least one of file header or presentation header were not
   // null, then append a line separator.
   // This should be useful in most cases and should not hurt.
   outputStream.write(convertToBytes(sb.toString()));
   outputStream.flush();
  }
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

void writeHeader() throws IOException {
 if (layout != null && (outputStream != null)) {
  StringBuilder sb = new StringBuilder();
  appendIfNotNull(sb, layout.getFileHeader());
  appendIfNotNull(sb, layout.getPresentationHeader());
  if (sb.length() > 0) {
   sb.append(CoreConstants.LINE_SEPARATOR);
   // If at least one of file header or presentation header were not
   // null, then append a line separator.
   // This should be useful in most cases and should not hurt.
   outputStream.write(convertToBytes(sb.toString()));
   outputStream.flush();
  }
 }
}

代码示例来源:origin: com.hynnet/logback-core

void writeHeader() throws IOException {
 if (layout != null && (outputStream != null)) {
  StringBuilder sb = new StringBuilder();
  appendIfNotNull(sb, layout.getFileHeader());
  appendIfNotNull(sb, layout.getPresentationHeader());
  if (sb.length() > 0) {
   sb.append(CoreConstants.LINE_SEPARATOR);
   // If at least one of file header or presentation header were not
   // null, then append a line separator.
   // This should be useful in most cases and should not hurt.
   outputStream.write(convertToBytes(sb.toString()));
   outputStream.flush();
  }
 }
}

代码示例来源:origin: Nextdoor/bender

@Override
public byte[] headerBytes() {
  if (layout == null)
    return null;
  StringBuilder sb = new StringBuilder();
  appendIfNotNull(sb, layout.getFileHeader());
  appendIfNotNull(sb, layout.getPresentationHeader());
  if (sb.length() > 0) {
    // If at least one of file header or presentation header were not
    // null, then append a line separator.
    // This should be useful in most cases and should not hurt.
    sb.append(CoreConstants.LINE_SEPARATOR);
  }
  return convertToBytes(sb.toString());
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override
public byte[] headerBytes() {
  if (layout == null)
    return null;
  StringBuilder sb = new StringBuilder();
  appendIfNotNull(sb, layout.getFileHeader());
  appendIfNotNull(sb, layout.getPresentationHeader());
  if (sb.length() > 0) {
    // If at least one of file header or presentation header were not
    // null, then append a line separator.
    // This should be useful in most cases and should not hurt.
    sb.append(CoreConstants.LINE_SEPARATOR);
  }
  return convertToBytes(sb.toString());
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public byte[] headerBytes() {
  if (layout == null)
    return null;
  StringBuilder sb = new StringBuilder();
  appendIfNotNull(sb, layout.getFileHeader());
  appendIfNotNull(sb, layout.getPresentationHeader());
  if (sb.length() > 0) {
    // If at least one of file header or presentation header were not
    // null, then append a line separator.
    // This should be useful in most cases and should not hurt.
    sb.append(CoreConstants.LINE_SEPARATOR);
  }
  return convertToBytes(sb.toString());
}

代码示例来源:origin: tony19/logback-android

@Override
public byte[] headerBytes() {
 if (layout == null) {
  return null;
 }
 StringBuilder sb = new StringBuilder();
 appendIfNotNull(sb, layout.getFileHeader());
 appendIfNotNull(sb, layout.getPresentationHeader());
 if (sb.length() > 0) {
  // If at least one of file header or presentation header were not
  // null, then append a line separator.
  // This should be useful in most cases and should not hurt.
  sb.append(CoreConstants.LINE_SEPARATOR);
 }
 return convertToBytes(sb.toString());
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

void writeHeader() {
 if (layout != null && (this.writer != null)) {
  try {
   StringBuilder sb = new StringBuilder();
   appendIfNotNull(sb, layout.getFileHeader());
   appendIfNotNull(sb, layout.getPresentationHeader());
   if (sb.length() > 0) {
    sb.append(CoreConstants.LINE_SEPARATOR);
    // If at least one of file header or presentation header were not
    // null, then append a line separator.
    // This should be useful in most cases and should not hurt.
    writerWrite(sb.toString(), true);
   }
  } catch (IOException ioe) {
   this.started = false;
   addStatus(new ErrorStatus("Failed to write header for appender named ["
     + name + "].", this, ioe));
  }
 }
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

String header = layout.getFileHeader();
if (header != null) {
 sbuf.append(header);

代码示例来源:origin: ch.qos.logback/core

String header = layout.getFileHeader();
if (header != null) {
 sbuf.append(header);

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

String header = layout.getFileHeader();
if (header != null) {
 sbuf.append(header);

代码示例来源:origin: tony19/logback-android

String header = layout.getFileHeader();
if (header != null) {
 sbuf.append(header);

代码示例来源:origin: com.hynnet/logback-core

String header = layout.getFileHeader();
if (header != null) {
 sbuf.append(header);

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

String header = layout.getFileHeader();
if (header != null) {
  sbuf.append(header);

代码示例来源:origin: io.virtdata/virtdata-lib-realer

String header = layout.getFileHeader();
if (header != null) {
  sbuf.append(header);

代码示例来源:origin: Nextdoor/bender

String header = layout.getFileHeader();
if (header != null) {
  sbuf.append(header);

相关文章