1 | import { protos, ServiceContext } from '@google-cloud/logging';
|
2 | import { LogSeverityFunctions } from '@google-cloud/logging/build/src/utils/log-common';
|
3 | import { Options } from '.';
|
4 | import { Entry, LogEntry } from '@google-cloud/logging/build/src/entry';
|
5 | type Callback = (err: Error | null, apiResponse?: {}) => void;
|
6 | export type MonitoredResource = protos.google.api.MonitoredResource;
|
7 | export interface StackdriverData {
|
8 | serviceContext?: ServiceContext;
|
9 | message?: string;
|
10 | metadata?: Metadata | MetadataArg;
|
11 | }
|
12 | export interface Metadata {
|
13 | stack?: string;
|
14 | httpRequest?: protos.google.logging.type.IHttpRequest;
|
15 | labels?: {};
|
16 | [key: string]: any;
|
17 | }
|
18 |
|
19 |
|
20 |
|
21 | export declare const LOGGING_TRACE_KEY = "logging.googleapis.com/trace";
|
22 |
|
23 |
|
24 |
|
25 | export declare const LOGGING_SPAN_KEY = "logging.googleapis.com/spanId";
|
26 |
|
27 |
|
28 |
|
29 | export declare const LOGGING_SAMPLED_KEY = "logging.googleapis.com/trace_sampled";
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export declare const NODEJS_WINSTON_DEFAULT_LIBRARY_VERSION = "5.2.3";
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | export declare function getCurrentTraceFromAgent(): string | null;
|
42 | export declare class LoggingCommon {
|
43 | readonly logName: string;
|
44 | private inspectMetadata;
|
45 | private levels;
|
46 | cloudLog: LogSeverityFunctions;
|
47 | private resource;
|
48 | private serviceContext;
|
49 | private prefix;
|
50 | private labels;
|
51 | private defaultCallback?;
|
52 | redirectToStdout: boolean;
|
53 | static readonly LOGGING_TRACE_KEY = "logging.googleapis.com/trace";
|
54 | static readonly LOGGING_SPAN_KEY = "logging.googleapis.com/spanId";
|
55 | constructor(options?: Options);
|
56 | log(level: string, message: string, metadata: MetadataArg | undefined, callback: Callback): void;
|
57 | entry(metadata?: LogEntry, data?: string | {}): Entry;
|
58 | }
|
59 | export declare function getNodejsLibraryVersion(): string;
|
60 | type MetadataArg = {
|
61 | stack?: {};
|
62 | |
63 |
|
64 |
|
65 | httpRequest?: protos.google.logging.type.IHttpRequest;
|
66 | labels?: {};
|
67 | timestamp?: {};
|
68 | logName?: string;
|
69 | } & {
|
70 | [key: string]: string | {};
|
71 | };
|
72 | export {};
|