send attachment to mobile and take picture

This commit is contained in:
Peter Maquiran
2024-08-16 11:26:31 +01:00
parent d1918d6695
commit 5f4d5ab1a8
12 changed files with 139 additions and 135 deletions
@@ -65,3 +65,4 @@ export class ColoredLoggerService {
fatal(error?: any, message?: string, context?: string): void {}
}
+67
View File
@@ -0,0 +1,67 @@
// import { DateUtils } from './date';
export type MessageType = {
message: string;
context?: string;
obj?: object;
};
function getCurrentTime() {
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
const milliseconds = String(now.getMilliseconds()).padStart(3, '0');
return `${hours}:${minutes}:${seconds}.${milliseconds}`;
}
export class Logger {
constructor() {}
static log(message: string, obj = {}): void {
console.log(
`[${getCurrentTime()}] %cINFO : `, // Console Message
'color: #00897B', // CSS Style
Object.assign(obj, { createdAt: getCurrentTime(), message })
);
}
static debug(message: string, obj = {}): void {
console.info(
`[${getCurrentTime()}] %cINFO : `, // Console Message
'color: #039BE5', // CSS Style
Object.assign(obj, {createdAt: getCurrentTime(), message })
);
}
static info(message: string, obj = {}): void {
console.info(
`[${getCurrentTime()}] %cINFO : `, // Console Message
'color: #039BE5', // CSS Style
Object.assign(obj, { createdAt: getCurrentTime(), message })
);
}
static warn(message: string, obj = {}): void {
console.warn(
`[${getCurrentTime()}] %cWARN : `, // Console Message
'color: #FB8C00', // CSS Style
Object.assign(obj, { createdAt: getCurrentTime(), message })
);
}
static error(message?: string, obj = {}): void {
console.error(
`[${getCurrentTime()}] %cERROR : `, // Console Message
'color: #E53935', // CSS Style
message+', '+
'\n',
(obj as any)?.error,
'\n',
);
}
fatal(error?: any, message?: string, context?: string): void {}
}