mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-08-06 01:03:52 +09:00
Refactor
This commit is contained in:
9
src/utils/log.ts
Normal file
9
src/utils/log.ts
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user