@mingxy/ocosay 1.1.28 → 1.1.29
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/dist/package.json +1 -1
- package/dist/plugin.js +6 -5
- package/dist/utils/logger.js +5 -5
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -6774,14 +6774,15 @@ var createFormatStream = () => new Transform({
|
|
|
6774
6774
|
callback();
|
|
6775
6775
|
}
|
|
6776
6776
|
});
|
|
6777
|
-
var stdoutStream = createFormatStream();
|
|
6778
|
-
stdoutStream.pipe(process.stdout);
|
|
6779
6777
|
var fileStream = null;
|
|
6780
6778
|
try {
|
|
6781
6779
|
const fileDest = import_pino.default.destination({ dest: logFile, mkdir: true });
|
|
6782
6780
|
fileStream = createFormatStream();
|
|
6783
6781
|
fileStream.pipe(fileDest);
|
|
6784
6782
|
} catch {
|
|
6783
|
+
const stdoutStream = createFormatStream();
|
|
6784
|
+
stdoutStream.pipe(process.stdout);
|
|
6785
|
+
fileStream = stdoutStream;
|
|
6785
6786
|
}
|
|
6786
6787
|
var logger = (0, import_pino.default)(
|
|
6787
6788
|
{
|
|
@@ -6793,8 +6794,7 @@ var logger = (0, import_pino.default)(
|
|
|
6793
6794
|
}
|
|
6794
6795
|
},
|
|
6795
6796
|
import_pino.default.multistream([
|
|
6796
|
-
{ stream:
|
|
6797
|
-
...fileStream ? [{ stream: fileStream }] : []
|
|
6797
|
+
{ stream: fileStream }
|
|
6798
6798
|
])
|
|
6799
6799
|
);
|
|
6800
6800
|
function createModuleLogger(module) {
|
|
@@ -10482,8 +10482,9 @@ async function tryCompileSpeaker() {
|
|
|
10482
10482
|
}
|
|
10483
10483
|
}
|
|
10484
10484
|
const rebuildResult = await execAsync("npm rebuild speaker", opencodeNodeModules);
|
|
10485
|
+
result.stderr = (rebuildResult.stdout || "") + "\n" + (rebuildResult.stderr || "");
|
|
10485
10486
|
if (rebuildResult.error) {
|
|
10486
|
-
result.stderr
|
|
10487
|
+
result.stderr += "\n" + (rebuildResult.error.message || "");
|
|
10487
10488
|
}
|
|
10488
10489
|
if (await verifyModuleLoad(dep)) {
|
|
10489
10490
|
result.success = true;
|
package/dist/utils/logger.js
CHANGED
|
@@ -33,8 +33,6 @@ const createFormatStream = () => new Transform({
|
|
|
33
33
|
callback();
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
const stdoutStream = createFormatStream();
|
|
37
|
-
stdoutStream.pipe(process.stdout);
|
|
38
36
|
let fileStream = null;
|
|
39
37
|
try {
|
|
40
38
|
const fileDest = pino.destination({ dest: logFile, mkdir: true });
|
|
@@ -42,7 +40,10 @@ try {
|
|
|
42
40
|
fileStream.pipe(fileDest);
|
|
43
41
|
}
|
|
44
42
|
catch {
|
|
45
|
-
// fallback
|
|
43
|
+
// fallback: 如果文件流创建失败,使用 stdout
|
|
44
|
+
const stdoutStream = createFormatStream();
|
|
45
|
+
stdoutStream.pipe(process.stdout);
|
|
46
|
+
fileStream = stdoutStream;
|
|
46
47
|
}
|
|
47
48
|
export const logger = pino({
|
|
48
49
|
level,
|
|
@@ -52,8 +53,7 @@ export const logger = pino({
|
|
|
52
53
|
level: (label) => ({ level: label }),
|
|
53
54
|
},
|
|
54
55
|
}, pino.multistream([
|
|
55
|
-
{ stream:
|
|
56
|
-
...(fileStream ? [{ stream: fileStream }] : [])
|
|
56
|
+
{ stream: fileStream }
|
|
57
57
|
]));
|
|
58
58
|
/**
|
|
59
59
|
* 创建带模块后缀的logger
|