@factorypure/logger 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -31,9 +31,8 @@ type LoggerOptions = {
31
31
  notifyClient?: Notify;
32
32
  fatalErrorSlackChannel: string;
33
33
  };
34
- export declare const attachRequestId: (asyncLocalStorage: AsyncLocalStorage<any>, user: {
34
+ export declare const attachRequestId: (asyncLocalStorage: AsyncLocalStorage<any>, user?: {
35
35
  id: number;
36
- email: string;
37
36
  }) => (req: Request, _res: Response, next: NextFunction) => void;
38
37
  export declare const logCrashes: () => void;
39
38
  export declare const reportCrashes: (logger: LogStream) => void;
package/dist/index.js CHANGED
@@ -145,7 +145,7 @@ export default class LoggerClient {
145
145
  export const attachRequestId = (asyncLocalStorage, user) => {
146
146
  return (req, _res, next) => {
147
147
  const availableCharacters = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0987654321";
148
- let id = `userId-${user.id}:userEmail-${user.email}:`;
148
+ let id = user ? `userId-${user.id}:` : 'system-request:';
149
149
  let uniqueKey = '';
150
150
  while (uniqueKey.length < 10) {
151
151
  uniqueKey +=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorypure/logger",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",