This commit is contained in:
syuilo
2019-01-15 18:58:04 +09:00
parent 93532bcf7f
commit c77a3f6be7
3 changed files with 2 additions and 2 deletions

9
src/utils/log.ts Normal file
View File

@ -0,0 +1,9 @@
export default function(msg: string) {
const now = new Date();
const date = `${zeroPad(now.getHours())}:${zeroPad(now.getMinutes())}:${zeroPad(now.getSeconds())}`;
console.log(`${date} ${msg}`);
}
function zeroPad(num: number, length: number = 2): string {
return ('0000000000' + num).slice(-length);
}