mirror of
https://github.com/misskey-dev/SyslogPro.git
synced 2025-04-28 18:27:27 +09:00
Fix typo includeStructuredData
This commit is contained in:
parent
2cb30e652d
commit
d1f7ca3e8f
@ -65,7 +65,7 @@ create formatted messages or use directly
|
||||
let rfc5424 = new SyslogPro.RFC5424({
|
||||
applicationName: 'MyApp',
|
||||
timestamp: true,
|
||||
encludeStructuredData: true
|
||||
includeStructuredData: true
|
||||
color: true,
|
||||
extendedColor: true,
|
||||
server: {
|
||||
|
10
docs/api.md
10
docs/api.md
@ -65,7 +65,7 @@ formatting classes so that they may run independently.
|
||||
* [.timestampUTC](#module_SyslogPro..RFC5424+timestampUTC) : <code>boolean</code>
|
||||
* [.timestampTZ](#module_SyslogPro..RFC5424+timestampTZ) : <code>boolean</code>
|
||||
* [.timestampMS](#module_SyslogPro..RFC5424+timestampMS) : <code>boolean</code>
|
||||
* [.encludeStructuredData](#module_SyslogPro..RFC5424+encludeStructuredData) : <code>boolean</code>
|
||||
* [.includeStructuredData](#module_SyslogPro..RFC5424+includeStructuredData) : <code>boolean</code>
|
||||
* [.utf8BOM](#module_SyslogPro..RFC5424+utf8BOM) : <code>boolean</code>
|
||||
* [.color](#module_SyslogPro..RFC5424+color) : <code>boolean</code>
|
||||
* [.extendedColor](#module_SyslogPro..RFC5424+extendedColor) : <code>boolean</code>
|
||||
@ -636,7 +636,7 @@ fashion where new messages are written to the class as needed.
|
||||
* [.timestampUTC](#module_SyslogPro..RFC5424+timestampUTC) : <code>boolean</code>
|
||||
* [.timestampTZ](#module_SyslogPro..RFC5424+timestampTZ) : <code>boolean</code>
|
||||
* [.timestampMS](#module_SyslogPro..RFC5424+timestampMS) : <code>boolean</code>
|
||||
* [.encludeStructuredData](#module_SyslogPro..RFC5424+encludeStructuredData) : <code>boolean</code>
|
||||
* [.includeStructuredData](#module_SyslogPro..RFC5424+includeStructuredData) : <code>boolean</code>
|
||||
* [.utf8BOM](#module_SyslogPro..RFC5424+utf8BOM) : <code>boolean</code>
|
||||
* [.color](#module_SyslogPro..RFC5424+color) : <code>boolean</code>
|
||||
* [.extendedColor](#module_SyslogPro..RFC5424+extendedColor) : <code>boolean</code>
|
||||
@ -674,7 +674,7 @@ Construct a new RFC5424 formatted Syslog object with user options
|
||||
| [options.timestampUTC] | <code>boolean</code> | <code>false</code> | RFC standard is for local time |
|
||||
| [options.timestampMS] | <code>boolean</code> | <code>false</code> | Timestamp with ms resolution |
|
||||
| [options.timestampTZ] | <code>boolean</code> | <code>true</code> | Should the timestamp included time zone |
|
||||
| [options.encludeStructuredData] | <code>boolean</code> | <code>false</code> | Included any provided structured data |
|
||||
| [options.includeStructuredData] | <code>boolean</code> | <code>false</code> | Included any provided structured data |
|
||||
| [options.utf8BOM] | <code>boolean</code> | <code>true</code> | Included the UTF8 |
|
||||
| [options.color] | <code>boolean</code> | <code>false</code> | Included the UTF8 |
|
||||
| [options.extendedColor] | <code>boolean</code> | <code>false</code> | Included the UTF8 encoding tag with syslog message text |
|
||||
@ -705,9 +705,9 @@ Construct a new RFC5424 formatted Syslog object with user options
|
||||
|
||||
#### rfC5424.timestampMS : <code>boolean</code>
|
||||
**Kind**: instance property of [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
|
||||
<a name="module_SyslogPro..RFC5424+encludeStructuredData"></a>
|
||||
<a name="module_SyslogPro..RFC5424+includeStructuredData"></a>
|
||||
|
||||
#### rfC5424.encludeStructuredData : <code>boolean</code>
|
||||
#### rfC5424.includeStructuredData : <code>boolean</code>
|
||||
**Kind**: instance property of [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
|
||||
<a name="module_SyslogPro..RFC5424+utf8BOM"></a>
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ class RFC5424 {
|
||||
* resolution
|
||||
* @param {boolean} [options.timestampTZ=true] - Should the timestamp
|
||||
* included time zone
|
||||
* @param {boolean} [options.encludeStructuredData=false] - Included
|
||||
* @param {boolean} [options.includeStructuredData=false] - Included
|
||||
* any provided structured data
|
||||
* @param {boolean} [options.utf8BOM=true] - Included the UTF8
|
||||
* @param {boolean} [options.color=false] - Included the UTF8
|
||||
@ -1333,11 +1333,11 @@ class RFC5424 {
|
||||
} else {
|
||||
this.timestampMS = false;
|
||||
}
|
||||
if (options.encludeStructuredData) {
|
||||
if (options.includeStructuredData) {
|
||||
/** @type {boolean} */
|
||||
this.encludeStructuredData = true;
|
||||
this.includeStructuredData = true;
|
||||
} else {
|
||||
this.encludeStructuredData = false;
|
||||
this.includeStructuredData = false;
|
||||
}
|
||||
if (typeof options.utf8BOM === 'undefined' || options.utf8BOM) {
|
||||
/** @type {boolean} */
|
||||
@ -1740,7 +1740,7 @@ Build Structured Data string
|
||||
```
|
||||
let structuredData = '-';
|
||||
const sdElementCount = msgStructuredData.length;
|
||||
if (this.encludeStructuredData && sdElementCount > 0) {
|
||||
if (this.includeStructuredData && sdElementCount > 0) {
|
||||
let sdElementNames = [];
|
||||
let sdElements = [];
|
||||
const sdElementNameRegEx = /(\[)(\S*)(\s|\])/;
|
||||
|
@ -1275,7 +1275,7 @@ uses BSD timeformat</p>
|
||||
* resolution
|
||||
* @param {boolean} [options.timestampTZ=true] - Should the timestamp
|
||||
* included time zone
|
||||
* @param {boolean} [options.encludeStructuredData=false] - Included
|
||||
* @param {boolean} [options.includeStructuredData=false] - Included
|
||||
* any provided structured data
|
||||
* @param {boolean} [options.utf8BOM=true] - Included the UTF8
|
||||
* @param {boolean} [options.color=false] - Included the UTF8
|
||||
@ -1341,11 +1341,11 @@ uses BSD timeformat</p>
|
||||
} <span class="hljs-keyword">else</span> {
|
||||
<span class="hljs-keyword">this</span>.timestampMS = <span class="hljs-literal">false</span>;
|
||||
}
|
||||
<span class="hljs-keyword">if</span> (options.encludeStructuredData) {
|
||||
<span class="hljs-keyword">if</span> (options.includeStructuredData) {
|
||||
<span class="hljs-comment">/** @type {boolean} */</span>
|
||||
<span class="hljs-keyword">this</span>.encludeStructuredData = <span class="hljs-literal">true</span>;
|
||||
<span class="hljs-keyword">this</span>.includeStructuredData = <span class="hljs-literal">true</span>;
|
||||
} <span class="hljs-keyword">else</span> {
|
||||
<span class="hljs-keyword">this</span>.encludeStructuredData = <span class="hljs-literal">false</span>;
|
||||
<span class="hljs-keyword">this</span>.includeStructuredData = <span class="hljs-literal">false</span>;
|
||||
}
|
||||
<span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> options.utf8BOM === <span class="hljs-string">'undefined'</span> || options.utf8BOM) {
|
||||
<span class="hljs-comment">/** @type {boolean} */</span>
|
||||
@ -1743,7 +1743,7 @@ uses BSD timeformat</p>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">let</span> structuredData = <span class="hljs-string">'-'</span>;
|
||||
<span class="hljs-keyword">const</span> sdElementCount = msgStructuredData.length;
|
||||
<span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.encludeStructuredData && sdElementCount > <span class="hljs-number">0</span>) {
|
||||
<span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.includeStructuredData && sdElementCount > <span class="hljs-number">0</span>) {
|
||||
<span class="hljs-keyword">let</span> sdElementNames = [];
|
||||
<span class="hljs-keyword">let</span> sdElements = [];
|
||||
<span class="hljs-keyword">const</span> sdElementNameRegEx = <span class="hljs-regexp">/(\[)(\S*)(\s|\])/</span>;</pre></div></div>
|
||||
|
@ -96,7 +96,7 @@ create formatted messages or use directly</p>
|
||||
<pre class="prettyprint source lang-js"><code> let rfc5424 = new SyslogPro.RFC5424({
|
||||
applicationName: 'MyApp',
|
||||
timestamp: true,
|
||||
encludeStructuredData: true
|
||||
includeStructuredData: true
|
||||
color: true,
|
||||
extendedColor: true,
|
||||
server: {
|
||||
|
@ -1091,7 +1091,7 @@ class RFC5424 {
|
||||
* resolution
|
||||
* @param {boolean} [options.timestampTZ=true] - Should the timestamp
|
||||
* included time zone
|
||||
* @param {boolean} [options.encludeStructuredData=false] - Included
|
||||
* @param {boolean} [options.includeStructuredData=false] - Included
|
||||
* any provided structured data
|
||||
* @param {boolean} [options.utf8BOM=true] - Included the UTF8
|
||||
* @param {boolean} [options.color=false] - Included the UTF8
|
||||
@ -1157,11 +1157,11 @@ class RFC5424 {
|
||||
} else {
|
||||
this.timestampMS = false;
|
||||
}
|
||||
if (options.encludeStructuredData) {
|
||||
if (options.includeStructuredData) {
|
||||
/** @type {boolean} */
|
||||
this.encludeStructuredData = true;
|
||||
this.includeStructuredData = true;
|
||||
} else {
|
||||
this.encludeStructuredData = false;
|
||||
this.includeStructuredData = false;
|
||||
}
|
||||
if (typeof options.utf8BOM === 'undefined' || options.utf8BOM) {
|
||||
/** @type {boolean} */
|
||||
@ -1494,7 +1494,7 @@ class RFC5424 {
|
||||
// Build Structured Data string
|
||||
let structuredData = '-';
|
||||
const sdElementCount = msgStructuredData.length;
|
||||
if (this.encludeStructuredData && sdElementCount > 0) {
|
||||
if (this.includeStructuredData && sdElementCount > 0) {
|
||||
let sdElementNames = [];
|
||||
let sdElements = [];
|
||||
const sdElementNameRegEx = /(\[)(\S*)(\s|\])/;
|
||||
|
@ -467,7 +467,7 @@ fashion where new messages are written to the class as needed.</div>
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>encludeStructuredData</code></td>
|
||||
<td class="name"><code>includeStructuredData</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
@ -1427,7 +1427,7 @@ fashion where new messages are written to the class as needed.</div>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="encludeStructuredData"><span class="type-signature"></span>encludeStructuredData<span class="type-signature"> :boolean</span></h4>
|
||||
<h4 class="name" id="includeStructuredData"><span class="type-signature"></span>includeStructuredData<span class="type-signature"> :boolean</span></h4>
|
||||
|
||||
|
||||
|
||||
|
10
index.js
10
index.js
@ -1052,7 +1052,7 @@ class RFC5424 {
|
||||
* resolution
|
||||
* @param {boolean} [options.timestampTZ=true] - Should the timestamp
|
||||
* included time zone
|
||||
* @param {boolean} [options.encludeStructuredData=false] - Included
|
||||
* @param {boolean} [options.includeStructuredData=false] - Included
|
||||
* any provided structured data
|
||||
* @param {boolean} [options.utf8BOM=true] - Included the UTF8
|
||||
* @param {boolean} [options.color=false] - Included the UTF8
|
||||
@ -1122,11 +1122,11 @@ class RFC5424 {
|
||||
} else {
|
||||
this.timestampMS = false;
|
||||
}
|
||||
if (options.encludeStructuredData) {
|
||||
if (options.includeStructuredData || options.encludeStructuredData) {
|
||||
/** @type {boolean} */
|
||||
this.encludeStructuredData = true;
|
||||
this.includeStructuredData = true;
|
||||
} else {
|
||||
this.encludeStructuredData = false;
|
||||
this.includeStructuredData = false;
|
||||
}
|
||||
if (typeof options.utf8BOM === 'undefined' || options.utf8BOM) {
|
||||
/** @type {boolean} */
|
||||
@ -1459,7 +1459,7 @@ class RFC5424 {
|
||||
// Build Structured Data string
|
||||
let structuredData = '-';
|
||||
const sdElementCount = msgStructuredData.length;
|
||||
if (this.encludeStructuredData && sdElementCount > 0) {
|
||||
if (this.includeStructuredData && sdElementCount > 0) {
|
||||
let sdElementNames = [];
|
||||
let sdElements = [];
|
||||
const sdElementNameRegEx = /(\[)(\S*)(\s|\])/;
|
||||
|
@ -373,7 +373,7 @@ describe('RFC5424 Class Tests', () => {
|
||||
timestampUTC: true,
|
||||
timestampTZ: false,
|
||||
timestampMS: true,
|
||||
encludeStructuredData: true,
|
||||
includeStructuredData: true,
|
||||
colors: {
|
||||
emergencyColor: 30,
|
||||
alertColor: 30,
|
||||
@ -428,7 +428,7 @@ describe('RFC5424 Class Tests', () => {
|
||||
let resultMsg = /<190>1 \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2} /;
|
||||
expect(result).toMatch(resultMsg);
|
||||
let rfc5424 = new SyslogPro.RFC5424({
|
||||
encludeStructuredData: true,
|
||||
includeStructuredData: true,
|
||||
color: true,
|
||||
extendedColor: false,
|
||||
timestamp: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user