Skip to content

Commit

Permalink
Merge branch 'master' into fix/test-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 authored Oct 17, 2024
2 parents a542cd6 + 9632222 commit bcdfb2a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "glific-frontend",
"version": "6.1.8",
"version": "6.1.9",
"private": true,
"type": "module",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/config/apolloclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const gqlClient = (navigate: any) => {
// @ts-ignore
switch (networkError.statusCode) {
case 401:
setLogs(`Error 401: logging user out`, 'error');
setLogs(`Error 401: logging user out, ${JSON.stringify(networkError)}`, 'error');
navigate('/logout/session');
break;
default:
Expand Down
10 changes: 8 additions & 2 deletions src/config/logs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import pino from 'pino';
import { createPinoBrowserSend, createWriteStream } from 'pino-logflare';
import { LOGFLARE_API, LOGFLARE_SOURCE } from '.';
import { getUserSession } from 'services/AuthService';

const setLogs = (message: any, type: string) => {
const orgId = getUserSession('organizationId');
const userId = getUserSession('id');

let logger: any;

if (LOGFLARE_API && LOGFLARE_SOURCE) {
Expand Down Expand Up @@ -33,11 +37,13 @@ const setLogs = (message: any, type: string) => {
stream
);

let logMessage = message;
let logMessage;
if (typeof message === 'object') {
logMessage = JSON.stringify(message);
message = JSON.stringify(message);
}

logMessage = `org_id: ${orgId} user_id: ${userId} [${type}] ${message}`;

// log some events
switch (type) {
case 'info':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ export const ConversationHeader = ({
options = (
<>
{viewDetails}
{addMember}
{flowButton}
{addMember}
</>
);
} else {
Expand Down

0 comments on commit bcdfb2a

Please sign in to comment.