chore: improve postal data import observability
Add progress logging and a status script for postal imports and neighbor builds, and ignore local raw and generated postal datasets.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
export function createScriptLogger(prefix: string) {
|
||||
const startedAt = Date.now();
|
||||
|
||||
function elapsed() {
|
||||
const totalSeconds = Math.floor((Date.now() - startedAt) / 1000);
|
||||
const minutes = Math.floor(totalSeconds / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
return `${minutes}m ${seconds}s`;
|
||||
}
|
||||
|
||||
return {
|
||||
info(message: string) {
|
||||
console.log(`[${prefix}] ${message} (${elapsed()})`);
|
||||
},
|
||||
warn(message: string) {
|
||||
console.warn(`[${prefix}] ${message} (${elapsed()})`);
|
||||
},
|
||||
error(message: string) {
|
||||
console.error(`[${prefix}] ${message} (${elapsed()})`);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user