mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* logs: added a copy of the grafana-ui logs-files * fix: added the ansicolor package to the main grafana package * logs-components: import things from grafana-ui * import from local files * logs-components: other fixes * add betterer-exceptions * apply updates from grafana-ui package
28 lines
700 B
TypeScript
28 lines
700 B
TypeScript
import { LogLevel, LogRowModel, MutableDataFrame } from '@grafana/data';
|
|
|
|
export const createLogRow = (overrides?: Partial<LogRowModel>): LogRowModel => {
|
|
const uid = overrides?.uid || '1';
|
|
const timeEpochMs = overrides?.timeEpochMs || 1;
|
|
const entry = overrides?.entry || `log message ${uid}`;
|
|
|
|
return {
|
|
entryFieldIndex: 0,
|
|
rowIndex: 0,
|
|
dataFrame: new MutableDataFrame(),
|
|
uid,
|
|
logLevel: LogLevel.info,
|
|
entry,
|
|
hasAnsi: false,
|
|
hasUnescapedContent: false,
|
|
labels: {},
|
|
raw: entry,
|
|
timeFromNow: '',
|
|
timeEpochMs,
|
|
timeEpochNs: (timeEpochMs * 1000000).toString(),
|
|
timeLocal: '',
|
|
timeUtc: '',
|
|
searchWords: [],
|
|
...overrides,
|
|
};
|
|
};
|