Skip to content

Commit 3499221

Browse files
committed
chore: add timestamps to logging
1 parent cbd253e commit 3499221

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ export function getScanConfig(): ScanConfig {
1616
const validIncludePaths = scanPaths.filter((path) => {
1717
const isValid = validatePath(path);
1818
if (!isValid) {
19-
console.warn(`Invalid include path: ${path}`);
19+
console.warn(`${new Date().toLocaleString()} Invalid include path: ${path}`);
2020
}
2121
return isValid;
2222
});
2323

2424
const validExcludePaths = excludePaths.filter((path) => {
2525
const isValid = validatePath(path);
2626
if (!isValid) {
27-
console.warn(`Invalid exclude path: ${path}`);
27+
console.warn(`${new Date().toLocaleString()} Invalid exclude path: ${path}`);
2828
}
2929
return isValid;
3030
});
3131

3232
if (validIncludePaths.length === 0) {
33-
console.warn('No valid scan paths provided, defaulting to /scan_dir');
33+
console.warn(`${new Date().toLocaleString()} No valid scan paths provided, defaulting to /scan_dir`);
3434
validIncludePaths.push('/scan_dir');
3535
}
3636

37-
console.log('Scan configuration:', {
37+
console.log(`${new Date().toLocaleString()} Scan configuration:`, {
3838
includePaths: validIncludePaths,
3939
excludePaths: validExcludePaths,
4040
});

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function main(): Promise<void> {
1919
}
2020
} catch (error) {
2121
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
22-
console.error('Error:', errorMessage);
22+
console.error(`${new Date().toLocaleString()} Error:`, errorMessage);
2323
} finally {
2424
console.log(`${new Date().toLocaleString()} subsyncarr completed.`);
2525
}

0 commit comments

Comments
 (0)