@aikeytake/social-automation 2.0.2 → 2.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/package.json +1 -1
- package/src/utils/logger.js +12 -4
package/package.json
CHANGED
package/src/utils/logger.js
CHANGED
|
@@ -12,8 +12,12 @@ class Logger {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
ensureLogsDir() {
|
|
15
|
-
|
|
16
|
-
fs.
|
|
15
|
+
try {
|
|
16
|
+
if (!fs.existsSync(LOGS_DIR)) {
|
|
17
|
+
fs.mkdirSync(LOGS_DIR, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
} catch {
|
|
20
|
+
// Ignore - filesystem may not be writable (e.g., Vercel serverless)
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -32,8 +36,12 @@ class Logger {
|
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
writeToFile(type, message) {
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
try {
|
|
40
|
+
const filePath = this.getLogFilePath(type);
|
|
41
|
+
fs.appendFileSync(filePath, message + '\n');
|
|
42
|
+
} catch {
|
|
43
|
+
// Ignore - filesystem may not be writable
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
info(message, data) {
|