We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 988f6e8 commit 734e5efCopy full SHA for 734e5ef
src/debug.mjs
@@ -8,6 +8,25 @@ const UPLOAD_URL = 'https://awesomemaker.pythonanywhere.com/upload';
8
const DEBUG_FILE = '__debug__.txt';
9
const COMPRESSED_FILE = '__debug__.txt.gz';
10
11
+/**
12
+ * Appends a record to the debug log file.
13
+ *
14
+ * @param {any} data - The data to be recorded in the log.
15
+ */
16
+export function record(...data) {
17
+ try {
18
+ fs.appendFileSync(
19
+ DEBUG_FILE,
20
+ JSON.stringify({
21
+ timestamp: new Date().toISOString(),
22
+ data,
23
+ }) + '\n'
24
+ );
25
+ } catch (error) {
26
+ console.error('Error writing to log file:', error);
27
+ }
28
+}
29
+
30
/**
31
* Compresses the log file using gzip.
32
*/
0 commit comments