@contrast/agent 4.32.11 → 4.32.13

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.
Files changed (223) hide show
  1. package/lib/core/config/util.js +2 -1
  2. package/node_modules/file-stream-rotator/FileStreamRotator.js +200 -41
  3. package/node_modules/file-stream-rotator/LICENSE.txt +17 -0
  4. package/node_modules/file-stream-rotator/README.md +16 -1
  5. package/node_modules/file-stream-rotator/package.json +5 -5
  6. package/node_modules/file-stream-rotator/tests/every-minute-test.js +32 -15
  7. package/node_modules/file-stream-rotator/tests/every-second-test.js +16 -7
  8. package/node_modules/file-stream-rotator/tests/large-test.js +33 -0
  9. package/node_modules/file-stream-rotator/tests/rotate-on-size-without-date.js +103 -0
  10. package/node_modules/object-hash/dist/object_hash.js +1 -2
  11. package/node_modules/object-hash/index.js +33 -21
  12. package/node_modules/object-hash/package.json +20 -18
  13. package/node_modules/object-hash/readme.markdown +20 -5
  14. package/node_modules/winston-daily-rotate-file/README.md +81 -12
  15. package/node_modules/winston-daily-rotate-file/daily-rotate-file.js +69 -30
  16. package/node_modules/winston-daily-rotate-file/index.d.ts +119 -72
  17. package/node_modules/winston-daily-rotate-file/package.json +20 -19
  18. package/node_modules/winston-transport/.eslintrc +1 -1
  19. package/node_modules/winston-transport/.nyc_output/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
  20. package/node_modules/winston-transport/.nyc_output/processinfo/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
  21. package/node_modules/winston-transport/.nyc_output/processinfo/index.json +1 -1
  22. package/node_modules/winston-transport/CHANGELOG.md +11 -0
  23. package/node_modules/winston-transport/dist/index.js +2 -2
  24. package/node_modules/winston-transport/index.d.ts +2 -0
  25. package/node_modules/winston-transport/index.js +2 -2
  26. package/node_modules/winston-transport/node_modules/readable-stream/README.md +106 -0
  27. package/node_modules/winston-transport/node_modules/readable-stream/errors-browser.js +127 -0
  28. package/node_modules/winston-transport/node_modules/readable-stream/errors.js +116 -0
  29. package/node_modules/winston-transport/node_modules/readable-stream/experimentalWarning.js +17 -0
  30. package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/lib/_stream_duplex.js +41 -46
  31. package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/lib/_stream_passthrough.js +1 -11
  32. package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/lib/_stream_readable.js +271 -263
  33. package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/lib/_stream_transform.js +18 -42
  34. package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/lib/_stream_writable.js +101 -147
  35. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
  36. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
  37. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
  38. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
  39. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  40. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
  41. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
  42. package/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
  43. package/node_modules/winston-transport/node_modules/readable-stream/package.json +72 -0
  44. package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/readable-browser.js +2 -0
  45. package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/readable.js +5 -8
  46. package/node_modules/winston-transport/package.json +16 -14
  47. package/package.json +7 -7
  48. package/node_modules/colors/LICENSE +0 -25
  49. package/node_modules/colors/README.md +0 -221
  50. package/node_modules/colors/examples/normal-usage.js +0 -82
  51. package/node_modules/colors/examples/safe-string.js +0 -79
  52. package/node_modules/colors/index.d.ts +0 -136
  53. package/node_modules/colors/lib/colors.js +0 -211
  54. package/node_modules/colors/lib/custom/trap.js +0 -46
  55. package/node_modules/colors/lib/custom/zalgo.js +0 -110
  56. package/node_modules/colors/lib/extendStringPrototype.js +0 -110
  57. package/node_modules/colors/lib/index.js +0 -13
  58. package/node_modules/colors/lib/maps/america.js +0 -10
  59. package/node_modules/colors/lib/maps/rainbow.js +0 -12
  60. package/node_modules/colors/lib/maps/random.js +0 -11
  61. package/node_modules/colors/lib/maps/zebra.js +0 -5
  62. package/node_modules/colors/lib/styles.js +0 -95
  63. package/node_modules/colors/lib/system/has-flag.js +0 -35
  64. package/node_modules/colors/lib/system/supports-colors.js +0 -151
  65. package/node_modules/colors/package.json +0 -49
  66. package/node_modules/colors/safe.d.ts +0 -48
  67. package/node_modules/colors/safe.js +0 -10
  68. package/node_modules/colors/themes/generic-logging.js +0 -12
  69. package/node_modules/core-util-is/LICENSE +0 -19
  70. package/node_modules/core-util-is/README.md +0 -3
  71. package/node_modules/core-util-is/float.patch +0 -604
  72. package/node_modules/core-util-is/lib/util.js +0 -107
  73. package/node_modules/core-util-is/package.json +0 -36
  74. package/node_modules/core-util-is/test.js +0 -68
  75. package/node_modules/cycle/README.md +0 -49
  76. package/node_modules/cycle/cycle.js +0 -170
  77. package/node_modules/cycle/package.json +0 -16
  78. package/node_modules/fast-safe-stringify/.travis.yml +0 -8
  79. package/node_modules/fast-safe-stringify/CHANGELOG.md +0 -17
  80. package/node_modules/fast-safe-stringify/LICENSE +0 -23
  81. package/node_modules/fast-safe-stringify/benchmark.js +0 -137
  82. package/node_modules/fast-safe-stringify/index.d.ts +0 -8
  83. package/node_modules/fast-safe-stringify/index.js +0 -161
  84. package/node_modules/fast-safe-stringify/package.json +0 -50
  85. package/node_modules/fast-safe-stringify/readme.md +0 -154
  86. package/node_modules/fast-safe-stringify/test-stable.js +0 -311
  87. package/node_modules/fast-safe-stringify/test.js +0 -304
  88. package/node_modules/isarray/.npmignore +0 -1
  89. package/node_modules/isarray/.travis.yml +0 -4
  90. package/node_modules/isarray/Makefile +0 -6
  91. package/node_modules/isarray/README.md +0 -60
  92. package/node_modules/isarray/component.json +0 -19
  93. package/node_modules/isarray/index.js +0 -5
  94. package/node_modules/isarray/package.json +0 -49
  95. package/node_modules/isarray/test.js +0 -20
  96. package/node_modules/object-hash/.jshintrc +0 -19
  97. package/node_modules/object-hash/.travis.yml +0 -35
  98. package/node_modules/object-hash/bower.json +0 -15
  99. package/node_modules/object-hash/dist/object_hash.js.map +0 -1
  100. package/node_modules/object-hash/dist/object_hash_test.js +0 -4737
  101. package/node_modules/object-hash/gulpfile.js +0 -97
  102. package/node_modules/object-hash/karma.conf.js +0 -69
  103. package/node_modules/object-hash/test/blob.js +0 -41
  104. package/node_modules/object-hash/test/index.js +0 -290
  105. package/node_modules/object-hash/test/object-classes.js +0 -106
  106. package/node_modules/object-hash/test/old-crypto.js +0 -60
  107. package/node_modules/object-hash/test/replacer.js +0 -36
  108. package/node_modules/object-hash/test/types.js +0 -174
  109. package/node_modules/object-hash/test/writeToStream.js +0 -27
  110. package/node_modules/process-nextick-args/index.js +0 -45
  111. package/node_modules/process-nextick-args/license.md +0 -19
  112. package/node_modules/process-nextick-args/package.json +0 -29
  113. package/node_modules/process-nextick-args/readme.md +0 -18
  114. package/node_modules/readable-stream/.travis.yml +0 -34
  115. package/node_modules/readable-stream/README.md +0 -58
  116. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
  117. package/node_modules/readable-stream/duplex-browser.js +0 -1
  118. package/node_modules/readable-stream/duplex.js +0 -1
  119. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -79
  120. package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -74
  121. package/node_modules/readable-stream/package.json +0 -56
  122. package/node_modules/readable-stream/passthrough.js +0 -1
  123. package/node_modules/readable-stream/transform.js +0 -1
  124. package/node_modules/readable-stream/writable-browser.js +0 -1
  125. package/node_modules/readable-stream/writable.js +0 -8
  126. package/node_modules/winston-compat/.gitattributes +0 -1
  127. package/node_modules/winston-compat/.node-version +0 -1
  128. package/node_modules/winston-compat/CHANGELOG.md +0 -17
  129. package/node_modules/winston-compat/LICENSE +0 -22
  130. package/node_modules/winston-compat/README.md +0 -2
  131. package/node_modules/winston-compat/index.js +0 -295
  132. package/node_modules/winston-compat/lib/transport.js +0 -135
  133. package/node_modules/winston-compat/node_modules/fecha/CHANGELOG.md +0 -11
  134. package/node_modules/winston-compat/node_modules/fecha/LICENSE +0 -22
  135. package/node_modules/winston-compat/node_modules/fecha/README.md +0 -259
  136. package/node_modules/winston-compat/node_modules/fecha/fecha.d.ts +0 -47
  137. package/node_modules/winston-compat/node_modules/fecha/fecha.js +0 -334
  138. package/node_modules/winston-compat/node_modules/fecha/fecha.min.js +0 -1
  139. package/node_modules/winston-compat/node_modules/fecha/package.json +0 -44
  140. package/node_modules/winston-compat/node_modules/logform/.babelrc +0 -3
  141. package/node_modules/winston-compat/node_modules/logform/.eslintrc +0 -7
  142. package/node_modules/winston-compat/node_modules/logform/.gitattributes +0 -1
  143. package/node_modules/winston-compat/node_modules/logform/.travis.yml +0 -17
  144. package/node_modules/winston-compat/node_modules/logform/CHANGELOG.md +0 -103
  145. package/node_modules/winston-compat/node_modules/logform/LICENSE +0 -21
  146. package/node_modules/winston-compat/node_modules/logform/README.md +0 -170
  147. package/node_modules/winston-compat/node_modules/logform/align.js +0 -14
  148. package/node_modules/winston-compat/node_modules/logform/browser.js +0 -36
  149. package/node_modules/winston-compat/node_modules/logform/cli.js +0 -52
  150. package/node_modules/winston-compat/node_modules/logform/colorize.js +0 -118
  151. package/node_modules/winston-compat/node_modules/logform/combine.js +0 -66
  152. package/node_modules/winston-compat/node_modules/logform/dist/align.js +0 -14
  153. package/node_modules/winston-compat/node_modules/logform/dist/browser.js +0 -37
  154. package/node_modules/winston-compat/node_modules/logform/dist/cli.js +0 -75
  155. package/node_modules/winston-compat/node_modules/logform/dist/colorize.js +0 -147
  156. package/node_modules/winston-compat/node_modules/logform/dist/combine.js +0 -66
  157. package/node_modules/winston-compat/node_modules/logform/dist/format.js +0 -69
  158. package/node_modules/winston-compat/node_modules/logform/dist/index.js +0 -54
  159. package/node_modules/winston-compat/node_modules/logform/dist/json.js +0 -27
  160. package/node_modules/winston-compat/node_modules/logform/dist/label.js +0 -19
  161. package/node_modules/winston-compat/node_modules/logform/dist/levels.js +0 -15
  162. package/node_modules/winston-compat/node_modules/logform/dist/logstash.js +0 -32
  163. package/node_modules/winston-compat/node_modules/logform/dist/metadata.js +0 -63
  164. package/node_modules/winston-compat/node_modules/logform/dist/ms.js +0 -18
  165. package/node_modules/winston-compat/node_modules/logform/dist/pad-levels.js +0 -118
  166. package/node_modules/winston-compat/node_modules/logform/dist/pretty-print.js +0 -20
  167. package/node_modules/winston-compat/node_modules/logform/dist/printf.js +0 -40
  168. package/node_modules/winston-compat/node_modules/logform/dist/simple.js +0 -36
  169. package/node_modules/winston-compat/node_modules/logform/dist/splat.js +0 -147
  170. package/node_modules/winston-compat/node_modules/logform/dist/timestamp.js +0 -28
  171. package/node_modules/winston-compat/node_modules/logform/dist/uncolorize.js +0 -31
  172. package/node_modules/winston-compat/node_modules/logform/examples/combine.js +0 -14
  173. package/node_modules/winston-compat/node_modules/logform/examples/filter.js +0 -30
  174. package/node_modules/winston-compat/node_modules/logform/examples/invalid.js +0 -6
  175. package/node_modules/winston-compat/node_modules/logform/examples/metadata.js +0 -78
  176. package/node_modules/winston-compat/node_modules/logform/examples/padLevels.js +0 -39
  177. package/node_modules/winston-compat/node_modules/logform/examples/volume.js +0 -25
  178. package/node_modules/winston-compat/node_modules/logform/format.js +0 -52
  179. package/node_modules/winston-compat/node_modules/logform/index.d.ts +0 -53
  180. package/node_modules/winston-compat/node_modules/logform/index.js +0 -52
  181. package/node_modules/winston-compat/node_modules/logform/json.js +0 -26
  182. package/node_modules/winston-compat/node_modules/logform/label.js +0 -19
  183. package/node_modules/winston-compat/node_modules/logform/levels.js +0 -12
  184. package/node_modules/winston-compat/node_modules/logform/logstash.js +0 -29
  185. package/node_modules/winston-compat/node_modules/logform/metadata.js +0 -61
  186. package/node_modules/winston-compat/node_modules/logform/ms.js +0 -18
  187. package/node_modules/winston-compat/node_modules/logform/package.json +0 -51
  188. package/node_modules/winston-compat/node_modules/logform/pad-levels.js +0 -83
  189. package/node_modules/winston-compat/node_modules/logform/pretty-print.js +0 -16
  190. package/node_modules/winston-compat/node_modules/logform/printf.js +0 -26
  191. package/node_modules/winston-compat/node_modules/logform/simple.js +0 -33
  192. package/node_modules/winston-compat/node_modules/logform/splat.js +0 -125
  193. package/node_modules/winston-compat/node_modules/logform/timestamp.js +0 -30
  194. package/node_modules/winston-compat/node_modules/logform/tsconfig.json +0 -22
  195. package/node_modules/winston-compat/node_modules/logform/uncolorize.js +0 -27
  196. package/node_modules/winston-compat/package.json +0 -46
  197. package/node_modules/winston-compat/test/clone.test.js +0 -25
  198. package/node_modules/winston-compat/test/helpers.js +0 -256
  199. package/node_modules/winston-compat/test/timestamp.test.js +0 -14
  200. package/node_modules/winston-compat/test/transports/transport.js +0 -205
  201. package/node_modules/winston-compat/test/winston-compat.test.js +0 -18
  202. package/node_modules/winston-daily-rotate-file/.eslintrc.js +0 -11
  203. package/node_modules/winston-daily-rotate-file/.node-version +0 -1
  204. package/node_modules/winston-daily-rotate-file/.travis.yml +0 -15
  205. package/node_modules/winston-daily-rotate-file/node_modules/semver/CHANGELOG.md +0 -70
  206. package/node_modules/winston-daily-rotate-file/node_modules/semver/LICENSE +0 -15
  207. package/node_modules/winston-daily-rotate-file/node_modules/semver/README.md +0 -443
  208. package/node_modules/winston-daily-rotate-file/node_modules/semver/bin/semver.js +0 -174
  209. package/node_modules/winston-daily-rotate-file/node_modules/semver/package.json +0 -32
  210. package/node_modules/winston-daily-rotate-file/node_modules/semver/range.bnf +0 -16
  211. package/node_modules/winston-daily-rotate-file/node_modules/semver/semver.js +0 -1596
  212. package/node_modules/winston-daily-rotate-file/test/memory-stream.js +0 -38
  213. package/node_modules/winston-daily-rotate-file/test/random-string.js +0 -31
  214. package/node_modules/winston-daily-rotate-file/test/transport-tests.js +0 -250
  215. package/node_modules/winston-transport/.nyc_output/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
  216. package/node_modules/winston-transport/.nyc_output/processinfo/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
  217. package/node_modules/winston-transport/.travis.yml +0 -17
  218. package/node_modules/winston-transport/tsconfig.json +0 -22
  219. /package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/CONTRIBUTING.md +0 -0
  220. /package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/GOVERNANCE.md +0 -0
  221. /package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/LICENSE +0 -0
  222. /package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/lib/internal/streams/stream-browser.js +0 -0
  223. /package/node_modules/{readable-stream → winston-transport/node_modules/readable-stream}/lib/internal/streams/stream.js +0 -0
@@ -1,56 +0,0 @@
1
- {
2
- "name": "readable-stream",
3
- "version": "2.3.7",
4
- "description": "Streams3, a user-land copy of the stream library from Node.js",
5
- "main": "readable.js",
6
- "dependencies": {
7
- "core-util-is": "~1.0.0",
8
- "inherits": "~2.0.3",
9
- "isarray": "~1.0.0",
10
- "process-nextick-args": "~2.0.0",
11
- "safe-buffer": "~5.1.1",
12
- "string_decoder": "~1.1.1",
13
- "util-deprecate": "~1.0.1"
14
- },
15
- "devDependencies": {
16
- "assert": "^1.4.0",
17
- "babel-polyfill": "^6.9.1",
18
- "buffer": "^4.9.0",
19
- "lolex": "^2.3.2",
20
- "nyc": "^6.4.0",
21
- "tap": "^0.7.0",
22
- "tape": "^4.8.0"
23
- },
24
- "scripts": {
25
- "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js",
26
- "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
27
- "cover": "nyc npm test",
28
- "report": "nyc report --reporter=lcov"
29
- },
30
- "repository": {
31
- "type": "git",
32
- "url": "git://github.com/nodejs/readable-stream"
33
- },
34
- "keywords": [
35
- "readable",
36
- "stream",
37
- "pipe"
38
- ],
39
- "browser": {
40
- "util": false,
41
- "./readable.js": "./readable-browser.js",
42
- "./writable.js": "./writable-browser.js",
43
- "./duplex.js": "./duplex-browser.js",
44
- "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
45
- },
46
- "nyc": {
47
- "include": [
48
- "lib/**.js"
49
- ]
50
- },
51
- "license": "MIT"
52
-
53
- ,"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz"
54
- ,"_integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw=="
55
- ,"_from": "readable-stream@2.3.7"
56
- }
@@ -1 +0,0 @@
1
- module.exports = require('./readable').PassThrough
@@ -1 +0,0 @@
1
- module.exports = require('./readable').Transform
@@ -1 +0,0 @@
1
- module.exports = require('./lib/_stream_writable.js');
@@ -1,8 +0,0 @@
1
- var Stream = require("stream")
2
- var Writable = require("./lib/_stream_writable.js")
3
-
4
- if (process.env.READABLE_STREAM === 'disable') {
5
- module.exports = Stream && Stream.Writable || Writable
6
- } else {
7
- module.exports = Writable
8
- }
@@ -1 +0,0 @@
1
- package-lock.json binary
@@ -1 +0,0 @@
1
- 10.15.1
@@ -1,17 +0,0 @@
1
- # CHANGELOG
2
-
3
- ### 0.1.2
4
-
5
- - [#7] require `'util'`.
6
-
7
- ### 0.1.1
8
-
9
- - Move `vows` to `devDependencies`.
10
-
11
- ### 0.1.0
12
-
13
- - Add legacy `vows`-based test helpers.
14
-
15
- ### 0.0.1
16
-
17
- - Initial release
@@ -1,22 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Charlie Robbins & the contributors.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
@@ -1,2 +0,0 @@
1
- # winston-compat
2
- Core functionality from winston < 3.0.0 commonly used by user-created transports.
@@ -1,295 +0,0 @@
1
- 'use strict';
2
-
3
- var cycle = require('cycle');
4
- var util = require('util');
5
- var { levels, format } = require('logform');
6
- var { configs } = require('triple-beam');
7
- var { colorize } = format;
8
-
9
- levels(configs.cli);
10
- levels(configs.npm);
11
- levels(configs.syslog);
12
-
13
- //
14
- // Expose base Transport
15
- //
16
- exports.Transport = require('./lib/transport');
17
-
18
- //
19
- // ### function clone (obj)
20
- // #### @obj {Object} Object to clone.
21
- // Helper method for deep cloning pure JSON objects
22
- // i.e. JSON objects that are either literals or objects (no Arrays, etc)
23
- //
24
- exports.clone = function (obj) {
25
- //
26
- // We only need to clone reference types (Object)
27
- //
28
- var copy = {};
29
-
30
- if (obj instanceof Error) {
31
- // With potential custom Error objects, this might not be exactly correct,
32
- // but probably close-enough for purposes of this lib.
33
- copy = new Error(obj.message);
34
- Object.getOwnPropertyNames(obj).forEach(function (key) {
35
- copy[key] = obj[key];
36
- });
37
-
38
- return copy;
39
- }
40
- else if (!(obj instanceof Object)) {
41
- return obj;
42
- }
43
- else if (obj instanceof Date) {
44
- return new Date(obj.getTime());
45
- }
46
-
47
- for (var i in obj) {
48
- if (obj.hasOwnProperty(i)) {
49
- if (Array.isArray(obj[i])) {
50
- copy[i] = obj[i].slice(0);
51
- }
52
- else if (obj[i] instanceof Buffer) {
53
- copy[i] = obj[i].slice(0);
54
- }
55
- else if (typeof obj[i] != 'function') {
56
- copy[i] = obj[i] instanceof Object ? exports.clone(obj[i]) : obj[i];
57
- }
58
- else if (typeof obj[i] === 'function') {
59
- copy[i] = obj[i];
60
- }
61
- }
62
- }
63
-
64
- return copy;
65
- };
66
-
67
- //
68
- // ### function log (options)
69
- // #### @options {Object} All information about the log serialization.
70
- // Generic logging function for returning timestamped strings
71
- // with the following options:
72
- //
73
- // {
74
- // level: 'level to add to serialized message',
75
- // message: 'message to serialize',
76
- // meta: 'additional logging metadata to serialize',
77
- // colorize: false, // Colorizes output (only if `.json` is false)
78
- // align: false // Align message level.
79
- // timestamp: true // Adds a timestamp to the serialized message
80
- // label: 'label to prepend the message'
81
- // }
82
- //
83
- exports.log = function (options) {
84
- var timestampFn = typeof options.timestamp === 'function'
85
- ? options.timestamp
86
- : exports.timestamp,
87
- timestamp = options.timestamp ? timestampFn() : null,
88
- showLevel = options.showLevel === undefined ? true : options.showLevel,
89
- meta = options.meta !== null && options.meta !== undefined && !(options.meta instanceof Error)
90
- ? exports.clone(cycle.decycle(options.meta))
91
- : options.meta || null,
92
- output;
93
-
94
- //
95
- // raw mode is intended for outputing winston as streaming JSON to STDOUT
96
- //
97
- if (options.raw) {
98
- if (typeof meta !== 'object' && meta != null) {
99
- meta = { meta: meta };
100
- }
101
- output = exports.clone(meta) || {};
102
- output.level = options.level;
103
- //
104
- // Remark (jcrugzz): This used to be output.message = options.message.stripColors.
105
- // I do not know why this is, it does not make sense but im handling that
106
- // case here as well as handling the case that does make sense which is to
107
- // make the `output.message = options.message`
108
- //
109
- output.message = options.message.stripColors
110
- ? options.message.stripColors
111
- : options.message;
112
-
113
- return JSON.stringify(output);
114
- }
115
-
116
- //
117
- // json mode is intended for pretty printing multi-line json to the terminal
118
- //
119
- if (options.json || true === options.logstash) {
120
- if (typeof meta !== 'object' && meta != null) {
121
- meta = { meta: meta };
122
- }
123
-
124
- output = exports.clone(meta) || {};
125
- output.level = options.level;
126
- output.message = output.message || '';
127
-
128
- if (options.label) { output.label = options.label; }
129
- if (options.message) { output.message = options.message; }
130
- if (timestamp) { output.timestamp = timestamp; }
131
-
132
- if (options.logstash === true) {
133
- // use logstash format
134
- var logstashOutput = {};
135
- if (output.message !== undefined) {
136
- logstashOutput['@message'] = output.message;
137
- delete output.message;
138
- }
139
-
140
- if (output.timestamp !== undefined) {
141
- logstashOutput['@timestamp'] = output.timestamp;
142
- delete output.timestamp;
143
- }
144
-
145
- logstashOutput['@fields'] = exports.clone(output);
146
- output = logstashOutput;
147
- }
148
-
149
- if (typeof options.stringify === 'function') {
150
- return options.stringify(output);
151
- }
152
-
153
- return JSON.stringify(output, function (key, value) {
154
- return value instanceof Buffer
155
- ? value.toString('base64')
156
- : value;
157
- });
158
- }
159
-
160
- //
161
- // Remark: this should really be a call to `util.format`.
162
- //
163
- if (typeof options.formatter == 'function') {
164
- return String(options.formatter(exports.clone(options)));
165
- }
166
-
167
- output = timestamp ? timestamp + ' - ' : '';
168
- if (showLevel) {
169
- var opts = {};
170
- opts.level = options.colorize === 'level';
171
- opts.all = options.colorize === 'all' || options.colorize === true;
172
-
173
- output += opts.level || opts.all
174
- ? colorize().transform(options, opts).level
175
- : options.level;
176
- }
177
-
178
- output += (options.align) ? '\t' : '';
179
- output += (timestamp || showLevel) ? ': ' : '';
180
- output += options.label ? ('[' + options.label + '] ') : '';
181
- var opts = {};
182
- opts.message = options.colorize === 'message';
183
- opts.all = options.colorize === 'all';
184
-
185
- output += opts.all || opts.message
186
- ? colorize.transform(options, opts).message
187
- : options.message;
188
-
189
- if (meta !== null && meta !== undefined) {
190
- if (meta && meta instanceof Error && meta.stack) {
191
- meta = meta.stack;
192
- }
193
-
194
- if (typeof meta !== 'object') {
195
- output += ' ' + meta;
196
- }
197
- else if (Object.keys(meta).length > 0) {
198
- if (typeof options.prettyPrint === 'function') {
199
- output += ' ' + options.prettyPrint(meta);
200
- } else if (options.prettyPrint) {
201
- output += ' ' + '\n' + util.inspect(meta, false, options.depth || null, options.colorize);
202
- } else if (
203
- options.humanReadableUnhandledException
204
- && Object.keys(meta).length === 5
205
- && meta.hasOwnProperty('date')
206
- && meta.hasOwnProperty('process')
207
- && meta.hasOwnProperty('os')
208
- && meta.hasOwnProperty('trace')
209
- && meta.hasOwnProperty('stack')) {
210
-
211
- //
212
- // If meta carries unhandled exception data serialize the stack nicely
213
- //
214
- var stack = meta.stack;
215
- delete meta.stack;
216
- delete meta.trace;
217
- output += ' ' + exports.serialize(meta);
218
-
219
- if (stack) {
220
- output += '\n' + stack.join('\n');
221
- }
222
- } else {
223
- output += ' ' + exports.serialize(meta);
224
- }
225
- }
226
- }
227
-
228
- return output;
229
- };
230
-
231
- //
232
- // ### function serialize (obj, key)
233
- // #### @obj {Object|literal} Object to serialize
234
- // #### @key {string} **Optional** Optional key represented by obj in a larger object
235
- // Performs simple comma-separated, `key=value` serialization for Loggly when
236
- // logging to non-JSON inputs.
237
- //
238
- exports.serialize = function (obj, key) {
239
- if (obj === null) {
240
- obj = 'null';
241
- }
242
- else if (obj === undefined) {
243
- obj = 'undefined';
244
- }
245
- else if (obj === false) {
246
- obj = 'false';
247
- }
248
-
249
- if (typeof obj !== 'object') {
250
- return key ? key + '=' + obj : obj;
251
- }
252
-
253
- if (obj instanceof Buffer) {
254
- return key ? key + '=' + obj.toString('base64') : obj.toString('base64');
255
- }
256
-
257
- var msg = '',
258
- keys = Object.keys(obj),
259
- length = keys.length;
260
-
261
- for (var i = 0; i < length; i++) {
262
- if (Array.isArray(obj[keys[i]])) {
263
- msg += keys[i] + '=[';
264
-
265
- for (var j = 0, l = obj[keys[i]].length; j < l; j++) {
266
- msg += exports.serialize(obj[keys[i]][j]);
267
- if (j < l - 1) {
268
- msg += ', ';
269
- }
270
- }
271
-
272
- msg += ']';
273
- }
274
- else if (obj[keys[i]] instanceof Date) {
275
- msg += keys[i] + '=' + obj[keys[i]];
276
- }
277
- else {
278
- msg += exports.serialize(obj[keys[i]], keys[i]);
279
- }
280
-
281
- if (i < length - 1) {
282
- msg += ', ';
283
- }
284
- }
285
-
286
- return msg;
287
- };
288
-
289
- //
290
- // ### function timestamp ()
291
- // Returns a timestamp string for the current time.
292
- //
293
- exports.timestamp = function () {
294
- return new Date().toISOString();
295
- };
@@ -1,135 +0,0 @@
1
- /*
2
- * transport.js: Base Transport object for all Winston transports.
3
- *
4
- * (C) 2010 Charlie Robbins
5
- * MIT LICENCE
6
- *
7
- */
8
-
9
- var events = require('events'),
10
- util = require('util');
11
-
12
- //
13
- // ### function Transport (options)
14
- // #### @options {Object} Options for this instance.
15
- // Constructor function for the Tranport object responsible
16
- // base functionality for all winston transports.
17
- //
18
- var Transport = module.exports = function (options) {
19
- events.EventEmitter.call(this);
20
-
21
- options = options || {};
22
- this.silent = options.silent || false;
23
- this.raw = options.raw || false;
24
- this.name = options.name || this.name;
25
- this.formatter = options.formatter;
26
-
27
- //
28
- // Do not set a default level. When `level` is falsey on any
29
- // `Transport` instance, any `Logger` instance uses the
30
- // configured level (instead of the Transport level)
31
- //
32
- this.level = options.level;
33
-
34
- this.handleExceptions = options.handleExceptions || false;
35
- this.exceptionsLevel = options.exceptionsLevel || 'error';
36
- this.humanReadableUnhandledException = options.humanReadableUnhandledException || false;
37
- };
38
-
39
- //
40
- // Inherit from `events.EventEmitter`.
41
- //
42
- util.inherits(Transport, events.EventEmitter);
43
-
44
- //
45
- // ### function formatQuery (query)
46
- // #### @query {string|Object} Query to format
47
- // Formats the specified `query` Object (or string) to conform
48
- // with the underlying implementation of this transport.
49
- //
50
- Transport.prototype.formatQuery = function (query) {
51
- return query;
52
- };
53
-
54
- //
55
- // ### function normalizeQuery (query)
56
- // #### @options {string|Object} Query to normalize
57
- // Normalize options for query
58
- //
59
- Transport.prototype.normalizeQuery = function (options) {
60
- //
61
- // Use options similar to loggly.
62
- // [See Loggly Search API](http://wiki.loggly.com/retrieve_events#optional)
63
- //
64
-
65
- options = options || {};
66
-
67
- // limit
68
- options.rows = options.rows || options.limit || 10;
69
-
70
- // starting row offset
71
- options.start = options.start || 0;
72
-
73
- // now
74
- options.until = options.until || new Date;
75
- if (typeof options.until !== 'object') {
76
- options.until = new Date(options.until);
77
- }
78
-
79
- // now - 24
80
- options.from = options.from || (options.until - (24 * 60 * 60 * 1000));
81
- if (typeof options.from !== 'object') {
82
- options.from = new Date(options.from);
83
- }
84
-
85
-
86
- // 'asc' or 'desc'
87
- options.order = options.order || 'desc';
88
-
89
- // which fields to select
90
- options.fields = options.fields;
91
-
92
- return options;
93
- };
94
-
95
- //
96
- // ### function formatResults (results, options)
97
- // #### @results {Object|Array} Results returned from `.query`.
98
- // #### @options {Object} **Optional** Formatting options
99
- // Formats the specified `results` with the given `options` accordinging
100
- // to the implementation of this transport.
101
- //
102
- Transport.prototype.formatResults = function (results, options) {
103
- return results;
104
- };
105
-
106
- //
107
- // ### function logException (msg, meta, callback)
108
- // #### @msg {string} Message to log
109
- // #### @meta {Object} **Optional** Additional metadata to attach
110
- // #### @callback {function} Continuation to respond to when complete.
111
- // Logs the specified `msg`, `meta` and responds to the callback once the log
112
- // operation is complete to ensure that the event loop will not exit before
113
- // all logging has completed.
114
- //
115
- Transport.prototype.logException = function (msg, meta, callback) {
116
- var self = this,
117
- called;
118
-
119
- if (this.silent) {
120
- return callback();
121
- }
122
-
123
- function onComplete () {
124
- if (!called) {
125
- called = true;
126
- self.removeListener('logged', onComplete);
127
- self.removeListener('error', onComplete);
128
- callback();
129
- }
130
- }
131
-
132
- this.once('logged', onComplete);
133
- this.once('error', onComplete);
134
- this.log(self.exceptionsLevel, msg, meta, function () { });
135
- };
@@ -1,11 +0,0 @@
1
- ### 2.3.2
2
- Added typescript definitions to NPM
3
-
4
- ### 2.3.0
5
- Added strict version of date parser that returns null on invalid dates (may use strict version in v3)
6
-
7
- ### 2.2.0
8
- Fixed a bug when parsing Do format dates
9
-
10
- ## 2.0.0
11
- Fecha now throws errors on invalid dates in `fecha.format` and is stricter about what dates it accepts. Dates must pass `Object.prototype.toString.call(dateObj) !== '[object Date]'`.
@@ -1,22 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Taylor Hakes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-