1 | export declare type LogLevel = 'info' | 'trace' | 'debug' | 'warn' | 'error' | 'query';
|
2 | export interface RawRustLog {
|
3 | timestamp: string;
|
4 | level: LogLevel;
|
5 | target: string;
|
6 | fields: LogFields;
|
7 | }
|
8 | export interface RustLog {
|
9 | timestamp: Date;
|
10 | level: LogLevel;
|
11 | target: string;
|
12 | fields: LogFields;
|
13 | }
|
14 | export interface RustError {
|
15 | is_panic: boolean;
|
16 | message: string;
|
17 | backtrace: string;
|
18 | }
|
19 | export declare function isRustError(e: any): e is RustError;
|
20 | export declare type LogFields = PanicLogFields | InfoLogFields | {
|
21 | [key: string]: any;
|
22 | };
|
23 | export interface PanicLogFields {
|
24 | message: 'PANIC';
|
25 | reason: string;
|
26 | file: string;
|
27 | line: string;
|
28 | column: number;
|
29 | }
|
30 | export interface InfoLogFields {
|
31 | message: string;
|
32 | 'log.target': string;
|
33 | 'log.module_path': string;
|
34 | 'log.file': string;
|
35 | 'log.line': number;
|
36 | }
|
37 | export interface QueryLogFields {
|
38 | query: string;
|
39 | item_type: string;
|
40 | params: string;
|
41 | duration_ms: number;
|
42 | }
|
43 | export interface Log {
|
44 | message: string;
|
45 | level: LogLevel;
|
46 | date: Date;
|
47 | application: string;
|
48 | [key: string]: string | Date;
|
49 | }
|
50 | export declare function convertLog(rustLog: RawRustLog): RustLog;
|