@sentio/sdk 1.40.4-rc.4 → 1.40.5-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/logger.d.ts +1 -1
- package/lib/core/logger.js.map +1 -1
- package/package.json +4 -4
- package/src/core/logger.ts +1 -1
package/lib/core/logger.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class Logger extends NamedResultDescriptor {
|
|
|
6
6
|
private readonly ctx;
|
|
7
7
|
constructor(ctx: BaseContext, name?: string);
|
|
8
8
|
withName(name: string): Logger;
|
|
9
|
-
log(level: LogLevel, message: any, attributes?: Attributes): void;
|
|
9
|
+
protected log(level: LogLevel, message: any, attributes?: Attributes): void;
|
|
10
10
|
info(msg: any, attributes?: Attributes): void;
|
|
11
11
|
warn(msg: any, attributes?: Attributes): void;
|
|
12
12
|
error(msg: any, attributes?: Attributes): void;
|
package/lib/core/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":";;;AACA,2CAAyC;AACzC,yCAAkD;AAIlD,MAAa,MAAO,SAAQ,gCAAqB;IAC9B,GAAG,CAAa;IAEjC,YAAY,GAAgB,EAAE,IAAI,GAAG,EAAE;QACrC,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":";;;AACA,2CAAyC;AACzC,yCAAkD;AAIlD,MAAa,MAAO,SAAQ,gCAAqB;IAC9B,GAAG,CAAa;IAEjC,YAAY,GAAgB,EAAE,IAAI,GAAG,EAAE;QACrC,KAAK,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,EAAE,UAAU,CAAC,CAAA;IAC9C,CAAC;CACF;AA1CD,wBA0CC","sourcesContent":["import { BaseContext } from './base-context'\nimport { LogLevel } from '@sentio/protos'\nimport { NamedResultDescriptor } from './metadata'\n\nexport type Attributes = Record<string, any>\n\nexport class Logger extends NamedResultDescriptor {\n private readonly ctx: BaseContext\n\n constructor(ctx: BaseContext, name = '') {\n super(name)\n this.ctx = ctx\n }\n\n withName(name: string) {\n return new Logger(this.ctx, name)\n }\n\n protected log(level: LogLevel, message: any, attributes: Attributes = {}) {\n if (typeof message !== 'string' && !(message instanceof String)) {\n message = JSON.stringify(message)\n }\n\n this.ctx._res.logs.push({\n // name: this.name,\n metadata: this.ctx.getMetaData(this.name, {}), // GetRecordMetaData(this.ctx, this, {}),\n level,\n message,\n attributes: JSON.stringify(attributes),\n runtimeInfo: undefined,\n })\n }\n\n info(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.INFO, msg, attributes)\n }\n\n warn(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.WARNING, msg, attributes)\n }\n\n error(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.ERROR, msg, attributes)\n }\n\n critical(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.CRITICAL, msg, attributes)\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentio/sdk",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "1.40.
|
|
4
|
+
"version": "1.40.5-rc.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json",
|
|
7
7
|
"compile": "tsc -p . && cp src/utils/*.csv lib/utils",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@ethersproject/providers": "~5.7.0",
|
|
21
|
-
"@sentio/protos": "^1.40.
|
|
22
|
-
"@sentio/runtime": "^1.40.
|
|
21
|
+
"@sentio/protos": "^1.40.5-rc.1",
|
|
22
|
+
"@sentio/runtime": "^1.40.5-rc.1",
|
|
23
23
|
"@typechain/ethers-v5": "^10.0.0",
|
|
24
24
|
"bignumber.js": "^9.1.0",
|
|
25
25
|
"command-line-args": "^5.2.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"typedoc": {
|
|
52
52
|
"entryPoint": "./src/index.ts"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "55a92f577364bf124778197293d8b1b247b6108a"
|
|
55
55
|
}
|
package/src/core/logger.ts
CHANGED
|
@@ -16,7 +16,7 @@ export class Logger extends NamedResultDescriptor {
|
|
|
16
16
|
return new Logger(this.ctx, name)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
log(level: LogLevel, message: any, attributes: Attributes = {}) {
|
|
19
|
+
protected log(level: LogLevel, message: any, attributes: Attributes = {}) {
|
|
20
20
|
if (typeof message !== 'string' && !(message instanceof String)) {
|
|
21
21
|
message = JSON.stringify(message)
|
|
22
22
|
}
|