A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
feat: add logger to global
ammarahm-ed90a58965bd74
diff --git a/apps/mobile/src/utils/logger/index.ts b/apps/mobile/src/utils/logger/index.tsnew file mode 100644index 000000000..608821b4e--- /dev/null+++ b/apps/mobile/src/utils/logger/index.ts@@ -0,0 +1,24 @@+function info(context: string, ...logs: any[]) {+ console.log(`${new Date().toLocaleDateString()}::info::${context}:`, ...logs);+}++function error(context: string, ...logs: any[]) {+ console.log(`${new Date().toLocaleDateString()}::error::${context}: `, ...logs);+}++type Logger = {+ info: (context: string, ...logs: any[]) => void;+ error: (context: string, ...logs: any[]) => void;+};++declare global {+ // eslint-disable-next-line no-var+ var logger: Logger;+}++global.logger = {+ info,+ error+};++export {};