w-syslog 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,16 +24,16 @@ import _ from 'lodash-es'
24
24
  import w from 'wsemi'
25
25
  import WSyslog from './src/WSyslog.mjs'
26
26
 
27
- w.fsCleanFolder('./logs')
27
+ w.fsCleanFolder('./_logs')
28
28
 
29
29
  let log = await WSyslog()
30
30
  log.info({ event: 'runner', msg: 'start' })
31
- log.warn({ event: 'monitor-memory', msg: 'usage-high' })
31
+ log.warn({ event: 'monitor-memory', msg: 'usage-high', ratio: 85.4 })
32
32
  log.error({ event: 'crash', msg: 'db connection', code: 500 })
33
33
 
34
34
  await w.delay(2000) //等待2秒讓pino能flush數據
35
35
 
36
- let vpfs = w.fsTreeFolder('./logs')
36
+ let vpfs = w.fsTreeFolder('./_logs')
37
37
  // console.log('vpfs', vpfs)
38
38
 
39
39
  let fp = _.get(vpfs, `0.path`, '')
@@ -0,0 +1,4 @@
1
+ {"level":30,"time":1751780754861,"pid":12480,"hostname":"DESKTOP-6R7USAO","event":"runner","msg":"start"}
2
+ {"level":40,"time":1751780754861,"pid":12480,"hostname":"DESKTOP-6R7USAO","event":"monitor-memory","msg":"usage-high","ratio":85.4}
3
+ {"level":50,"time":1751780754861,"pid":12480,"hostname":"DESKTOP-6R7USAO","event":"crash","msg":"db connection","code":500}
4
+
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * formatter v1.0.1
2
+ * formatter v1.0.3
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * w-syslog v1.0.1
2
+ * w-syslog v1.0.3
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
package/docs/WSyslog.html CHANGED
@@ -127,7 +127,7 @@
127
127
 
128
128
  <h5 class="h5-examples">Example</h5>
129
129
 
130
- <pre class="prettyprint"><code>import fs from 'fs'
130
+ <pre class="prettyprint"><code>import fs from 'fs'
131
131
 
132
132
 
133
133
 
@@ -389,7 +389,7 @@
389
389
  <br class="clear">
390
390
 
391
391
  <footer>
392
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Sun Jul 06 2025 13:43:40 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
392
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Sun Jul 06 2025 13:46:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
393
393
  </footer>
394
394
 
395
395
  <script>prettyPrint();</script>
@@ -71,16 +71,16 @@ let __dirname = path.dirname(__filename)
71
71
  * import w from 'wsemi'
72
72
  * import WSyslog from './src/WSyslog.mjs'
73
73
  *
74
- * w.fsCleanFolder('./logs')
74
+ * w.fsCleanFolder('./_logs')
75
75
  *
76
76
  * let log = await WSyslog()
77
77
  * log.info({ event: 'runner', msg: 'start' })
78
- * log.warn({ event: 'monitor-memory', msg: 'usage-high' })
78
+ * log.warn({ event: 'monitor-memory', msg: 'usage-high', ratio: 85.4 })
79
79
  * log.error({ event: 'crash', msg: 'db connection', code: 500 })
80
80
  *
81
81
  * await w.delay(2000) //等待2秒讓pino能flush數據
82
82
  *
83
- * let vpfs = w.fsTreeFolder('./logs')
83
+ * let vpfs = w.fsTreeFolder('./_logs')
84
84
  * // console.log('vpfs', vpfs)
85
85
  *
86
86
  * let fp = _.get(vpfs, `0.path`, '')
@@ -153,7 +153,7 @@ export default WSyslog
153
153
  <br class="clear">
154
154
 
155
155
  <footer>
156
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Sun Jul 06 2025 13:43:40 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
156
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Sun Jul 06 2025 13:46:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
157
157
  </footer>
158
158
 
159
159
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
  <br class="clear">
72
72
 
73
73
  <footer>
74
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Sun Jul 06 2025 13:43:40 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Sun Jul 06 2025 13:46:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
package/g.mjs CHANGED
@@ -4,16 +4,16 @@ import w from 'wsemi'
4
4
  import WSyslog from './src/WSyslog.mjs'
5
5
 
6
6
 
7
- w.fsCleanFolder('./logs')
7
+ w.fsCleanFolder('./_logs')
8
8
 
9
9
  let log = await WSyslog()
10
10
  log.info({ event: 'runner', msg: 'start' })
11
- log.warn({ event: 'monitor-memory', msg: 'usage-high' })
11
+ log.warn({ event: 'monitor-memory', msg: 'usage-high', ratio: 85.4 })
12
12
  log.error({ event: 'crash', msg: 'db connection', code: 500 })
13
13
 
14
14
  await w.delay(2000) //等待2秒讓pino能flush數據
15
15
 
16
- let vpfs = w.fsTreeFolder('./logs')
16
+ let vpfs = w.fsTreeFolder('./_logs')
17
17
  // console.log('vpfs', vpfs)
18
18
 
19
19
  let fp = _.get(vpfs, `0.path`, '')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-syslog",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/w-syslog.umd.js",
5
5
  "dependencies": {
6
6
  "lodash-es": "^4.17.21",
package/src/WSyslog.mjs CHANGED
@@ -24,16 +24,16 @@ let __dirname = path.dirname(__filename)
24
24
  * import w from 'wsemi'
25
25
  * import WSyslog from './src/WSyslog.mjs'
26
26
  *
27
- * w.fsCleanFolder('./logs')
27
+ * w.fsCleanFolder('./_logs')
28
28
  *
29
29
  * let log = await WSyslog()
30
30
  * log.info({ event: 'runner', msg: 'start' })
31
- * log.warn({ event: 'monitor-memory', msg: 'usage-high' })
31
+ * log.warn({ event: 'monitor-memory', msg: 'usage-high', ratio: 85.4 })
32
32
  * log.error({ event: 'crash', msg: 'db connection', code: 500 })
33
33
  *
34
34
  * await w.delay(2000) //等待2秒讓pino能flush數據
35
35
  *
36
- * let vpfs = w.fsTreeFolder('./logs')
36
+ * let vpfs = w.fsTreeFolder('./_logs')
37
37
  * // console.log('vpfs', vpfs)
38
38
  *
39
39
  * let fp = _.get(vpfs, `0.path`, '')
@@ -9,16 +9,16 @@ describe('WSyslog', function() {
9
9
 
10
10
  it('test', async function() {
11
11
 
12
- w.fsCleanFolder('./logs')
12
+ w.fsCleanFolder('./_logs')
13
13
 
14
14
  let log = await WSyslog()
15
15
  log.info({ event: 'runner', msg: 'start' })
16
- log.warn({ event: 'monitor-memory', msg: 'usage-high' })
16
+ log.warn({ event: 'monitor-memory', msg: 'usage-high', ratio: 85.4 })
17
17
  log.error({ event: 'crash', msg: 'db connection', code: 500 })
18
18
 
19
19
  await w.delay(2000) //等待2秒讓pino能flush數據
20
20
 
21
- let vpfs = w.fsTreeFolder('./logs')
21
+ let vpfs = w.fsTreeFolder('./_logs')
22
22
  // console.log('vpfs', vpfs)
23
23
 
24
24
  let fp = _.get(vpfs, `0.path`, '')
@@ -1,4 +0,0 @@
1
- {"level":30,"time":1751780174415,"pid":24144,"hostname":"DESKTOP-6R7USAO","event":"runner","msg":"start"}
2
- {"level":40,"time":1751780174415,"pid":24144,"hostname":"DESKTOP-6R7USAO","event":"monitor-memory","msg":"usage-high"}
3
- {"level":50,"time":1751780174415,"pid":24144,"hostname":"DESKTOP-6R7USAO","event":"crash","msg":"db connection","code":500}
4
-