Add OS to record

Summary: OS will become useful later on, add it.

Reviewed By: antonk52

Differential Revision: D47989161

fbshipit-source-id: 3615544051b163b77f87e5c52e6ac9cae8c478d4
This commit is contained in:
Lorenzo Blasa
2023-08-02 07:56:17 -07:00
committed by Facebook GitHub Bot
parent d43173a8df
commit 2c24ec9f5d
2 changed files with 4 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ export type DeviceLogLevel =
export type ConnectionRecordEntry = { export type ConnectionRecordEntry = {
time: Date; time: Date;
type: 'warning' | 'info' | 'error'; type: 'warning' | 'info' | 'error';
os: DeviceOS;
device: string; device: string;
app: string; app: string;
message: string; message: string;

View File

@@ -47,10 +47,12 @@ class Recorder {
const device = clientQuery?.device ?? 'NONE'; const device = clientQuery?.device ?? 'NONE';
const app = clientQuery?.app ?? 'NONE'; const app = clientQuery?.app ?? 'NONE';
const medium = clientQuery?.medium ?? 'NONE'; const medium = clientQuery?.medium ?? 'NONE';
const os = clientQuery?.os ?? 'Browser';
const entry: CommandRecordEntry = { const entry: CommandRecordEntry = {
time: new Date(), time: new Date(),
type: payload.success ? 'info' : 'error', type: payload.success ? 'info' : 'error',
os,
device, device,
app, app,
message: payload.cmd, message: payload.cmd,
@@ -78,6 +80,7 @@ class Recorder {
const entry: ConnectionRecordEntry = { const entry: ConnectionRecordEntry = {
time: new Date(), time: new Date(),
type, type,
os: clientQuery.os,
device: clientQuery.device, device: clientQuery.device,
app: clientQuery.app, app: clientQuery.app,
message: args.join(' '), message: args.join(' '),