@rife/logger 0.0.6-beta.17 → 0.0.6-beta.19

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.
@@ -26,12 +26,12 @@ var __webpack_modules__ = {
26
26
  "use strict";
27
27
  const WAIT_MS = 10000;
28
28
  function wait(state, index, expected, timeout, done) {
29
- const max = timeout === 1 / 0 ? 1 / 0 : Date.now() + timeout;
29
+ const max = 1 / 0 === timeout ? 1 / 0 : Date.now() + timeout;
30
30
  const check = ()=>{
31
31
  const current = Atomics.load(state, index);
32
32
  if (current === expected) return void done(null, 'ok');
33
- if (max !== 1 / 0 && Date.now() > max) return void done(null, 'timed-out');
34
- const remaining = max === 1 / 0 ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
33
+ if (1 / 0 !== max && Date.now() > max) return void done(null, 'timed-out');
34
+ const remaining = 1 / 0 === max ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
35
35
  const result = Atomics.waitAsync(state, index, current, remaining);
36
36
  if (result.async) result.value.then(check);
37
37
  else setImmediate(check);
@@ -39,12 +39,12 @@ var __webpack_modules__ = {
39
39
  check();
40
40
  }
41
41
  function waitDiff(state, index, expected, timeout, done) {
42
- const max = timeout === 1 / 0 ? 1 / 0 : Date.now() + timeout;
42
+ const max = 1 / 0 === timeout ? 1 / 0 : Date.now() + timeout;
43
43
  const check = ()=>{
44
44
  const current = Atomics.load(state, index);
45
45
  if (current !== expected) return void done(null, 'ok');
46
- if (max !== 1 / 0 && Date.now() > max) return void done(null, 'timed-out');
47
- const remaining = max === 1 / 0 ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
46
+ if (1 / 0 !== max && Date.now() > max) return void done(null, 'timed-out');
47
+ const remaining = 1 / 0 === max ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
48
48
  const result = Atomics.waitAsync(state, index, expected, remaining);
49
49
  if (result.async) result.value.then((res)=>{
50
50
  if ('ok' === res) return void done(null, 'ok');
@@ -2,17 +2,12 @@ import "node:module";
2
2
  import path from "path";
3
3
  import pino from "pino";
4
4
  import { genTraceId, getTraceId, runInTrace } from "../trace.mjs";
5
- import { __webpack_require__ } from "../rslib-runtime.mjs";
6
5
  import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
7
6
  import { dirname as __rspack_dirname } from "node:path";
8
7
  var __rspack_import_meta_filename__ = __rspack_fileURLToPath(import.meta.url);
9
8
  var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
10
- import * as __rspack_external_pino_std_serializers_c7d9cf2d from "pino-std-serializers";
11
- __webpack_require__.add({
12
- "pino-std-serializers" (module) {
13
- module.exports = __rspack_external_pino_std_serializers_c7d9cf2d;
14
- }
15
- });
9
+ import { createRequire as __rspack_createRequire } from "node:module";
10
+ const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
16
11
  function getPinoConfig() {
17
12
  const targets = [];
18
13
  const rotate = `./rotate${path.extname(__rspack_import_meta_filename__)}`;
@@ -103,7 +98,7 @@ function createLogger() {
103
98
  };
104
99
  }
105
100
  function useExpress(logger, format) {
106
- const serializers = __webpack_require__("pino-std-serializers");
101
+ const serializers = __rspack_createRequire_require("pino-std-serializers");
107
102
  const mapHttpRequest = serializers.mapHttpRequest;
108
103
  const mapHttpResponse = serializers.mapHttpResponse || serializers.default.mapHttpResponse;
109
104
  const startTime = Symbol();
@@ -1,11 +1,6 @@
1
1
  import "node:module";
2
- import { __webpack_require__ } from "../rslib-runtime.mjs";
3
- import * as __rspack_external_rotating_file_stream_a9540b88 from "rotating-file-stream";
4
- __webpack_require__.add({
5
- "rotating-file-stream" (module) {
6
- module.exports = __rspack_external_rotating_file_stream_a9540b88;
7
- }
8
- });
2
+ import { createRequire as __rspack_createRequire } from "node:module";
3
+ const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
9
4
  const generator = (time, index)=>{
10
5
  if (!time) return 'server.log';
11
6
  time = new Date(time);
@@ -18,7 +13,7 @@ const generator = (time, index)=>{
18
13
  return `server.${time.getFullYear()}${month}${day}.log`;
19
14
  };
20
15
  const rotate = (options)=>{
21
- const { createStream } = __webpack_require__("rotating-file-stream");
16
+ const { createStream } = __rspack_createRequire_require("rotating-file-stream");
22
17
  const { path } = options;
23
18
  return createStream(generator, {
24
19
  size: '50M',