@rife/logger 0.0.6-beta.18 → 0.0.6-beta.20

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,18 +2,13 @@ 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
- });
16
- function getPinoConfig() {
9
+ import { createRequire as __rspack_createRequire } from "node:module";
10
+ const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
11
+ function createLogger() {
17
12
  const targets = [];
18
13
  const rotate = `./rotate${path.extname(__rspack_import_meta_filename__)}`;
19
14
  targets.push({
@@ -23,7 +18,7 @@ function getPinoConfig() {
23
18
  path: './logs/'
24
19
  }
25
20
  });
26
- if ("u" > typeof __isNodeSingleFileBundle || "u" > typeof __isVite || global?.__remix_devServerHooks || 'development' !== process.env.NODE_ENV) globalThis.__bundlerPathsOverrides = {
21
+ if ("u" > typeof RSTACK_NODE_SINGLE_FILE_BUNDLE || 'development' !== process.env.NODE_ENV) globalThis.__bundlerPathsOverrides = {
27
22
  'pino-pretty': path.join(__rspack_import_meta_dirname__, './worker/pino-pretty.cjs'),
28
23
  'pino-worker': path.join(__rspack_import_meta_dirname__, './worker/pino-worker.cjs'),
29
24
  [rotate]: path.join(__rspack_import_meta_dirname__, './worker/pino-rotate.cjs'),
@@ -86,9 +81,6 @@ function getPinoConfig() {
86
81
  }
87
82
  }
88
83
  };
89
- return config;
90
- }
91
- function createLogger() {
92
84
  const logger = pino({
93
85
  base: {
94
86
  pid: process.pid
@@ -96,14 +88,14 @@ function createLogger() {
96
88
  messageKey: 'message',
97
89
  errorKey: 'error',
98
90
  timestamp: pino.stdTimeFunctions.epochTime,
99
- ...getPinoConfig()
91
+ ...config
100
92
  });
101
93
  return {
102
94
  logger
103
95
  };
104
96
  }
105
97
  function useExpress(logger, format) {
106
- const serializers = __webpack_require__("pino-std-serializers");
98
+ const serializers = __rspack_createRequire_require("pino-std-serializers");
107
99
  const mapHttpRequest = serializers.mapHttpRequest;
108
100
  const mapHttpResponse = serializers.mapHttpResponse || serializers.default.mapHttpResponse;
109
101
  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',