mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 00:05:57 +08:00
feat: show milliseconds in timestamp in logs views (#4949)
* feat: show milliseconds in timestamp in logs views * fix: remove console log --------- Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com>
This commit is contained in:
parent
152aa4b518
commit
64bf580323
@ -157,8 +157,8 @@ function ListLogView({
|
|||||||
const timestampValue = useMemo(
|
const timestampValue = useMemo(
|
||||||
() =>
|
() =>
|
||||||
typeof flattenLogData.timestamp === 'string'
|
typeof flattenLogData.timestamp === 'string'
|
||||||
? dayjs(flattenLogData.timestamp).format()
|
? dayjs(flattenLogData.timestamp).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||||
: dayjs(flattenLogData.timestamp / 1e6).format(),
|
: dayjs(flattenLogData.timestamp / 1e6).format('YYYY-MM-DD HH:mm:ss.SSS'),
|
||||||
[flattenLogData.timestamp],
|
[flattenLogData.timestamp],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -90,12 +90,12 @@ function RawLogView({
|
|||||||
const text = useMemo(
|
const text = useMemo(
|
||||||
() =>
|
() =>
|
||||||
typeof data.timestamp === 'string'
|
typeof data.timestamp === 'string'
|
||||||
? `${dayjs(data.timestamp).format()} | ${attributesText} ${severityText} ${
|
? `${dayjs(data.timestamp).format(
|
||||||
data.body
|
'YYYY-MM-DD HH:mm:ss.SSS',
|
||||||
}`
|
)} | ${attributesText} ${severityText} ${data.body}`
|
||||||
: `${dayjs(
|
: `${dayjs(data.timestamp / 1e6).format(
|
||||||
data.timestamp / 1e6,
|
'YYYY-MM-DD HH:mm:ss.SSS',
|
||||||
).format()} | ${attributesText} ${severityText} ${data.body}`,
|
)} | ${attributesText} ${severityText} ${data.body}`,
|
||||||
[data.timestamp, data.body, severityText, attributesText],
|
[data.timestamp, data.body, severityText, attributesText],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -76,8 +76,8 @@ export const useTableView = (props: UseTableViewProps): UseTableViewResult => {
|
|||||||
render: (field, item): ColumnTypeRender<Record<string, unknown>> => {
|
render: (field, item): ColumnTypeRender<Record<string, unknown>> => {
|
||||||
const date =
|
const date =
|
||||||
typeof field === 'string'
|
typeof field === 'string'
|
||||||
? dayjs(field).format()
|
? dayjs(field).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||||
: dayjs(field / 1e6).format();
|
: dayjs(field / 1e6).format('YYYY-MM-DD HH:mm:ss.SSS');
|
||||||
return {
|
return {
|
||||||
children: (
|
children: (
|
||||||
<div className="table-timestamp">
|
<div className="table-timestamp">
|
||||||
|
@ -85,8 +85,8 @@ function LogControls(): JSX.Element | null {
|
|||||||
logs.map((log) => {
|
logs.map((log) => {
|
||||||
const timestamp =
|
const timestamp =
|
||||||
typeof log.timestamp === 'string'
|
typeof log.timestamp === 'string'
|
||||||
? dayjs(log.timestamp).format()
|
? dayjs(log.timestamp).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||||
: dayjs(log.timestamp / 1e6).format();
|
: dayjs(log.timestamp / 1e6).format('YYYY-MM-DD HH:mm:ss.SSS');
|
||||||
|
|
||||||
return FlatLogData({
|
return FlatLogData({
|
||||||
...log,
|
...log,
|
||||||
|
@ -531,8 +531,8 @@ function LogsExplorerViews({
|
|||||||
logs.map((log) => {
|
logs.map((log) => {
|
||||||
const timestamp =
|
const timestamp =
|
||||||
typeof log.timestamp === 'string'
|
typeof log.timestamp === 'string'
|
||||||
? dayjs(log.timestamp).format()
|
? dayjs(log.timestamp).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||||
: dayjs(log.timestamp / 1e6).format();
|
: dayjs(log.timestamp / 1e6).format('YYYY-MM-DD HH:mm:ss.SSS');
|
||||||
|
|
||||||
return FlatLogData({
|
return FlatLogData({
|
||||||
timestamp,
|
timestamp,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user