@ar.io/sdk 2.0.0 → 2.0.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.
@@ -26,26 +26,27 @@ class Logger {
26
26
  constructor({ level = 'info', } = {}) {
27
27
  if (level === 'none') {
28
28
  this.silent = true;
29
- return;
30
29
  }
31
- this.logger = (0, winston_1.createLogger)({
32
- level,
33
- silent: this.silent,
34
- defaultMeta: {
35
- name: 'ar-io-sdk',
36
- version: version_js_1.version,
37
- },
38
- format: winston_1.format.combine(winston_1.format.timestamp(), winston_1.format.json()),
39
- });
40
30
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
41
31
  // @ts-ignore
42
32
  if (typeof window !== 'undefined') {
43
33
  this.logger = console;
44
34
  }
45
35
  else {
46
- this.logger.add(new winston_1.transports.Console({
36
+ this.logger = (0, winston_1.createLogger)({
37
+ level,
38
+ silent: this.silent,
39
+ defaultMeta: {
40
+ name: 'ar-io-sdk',
41
+ version: version_js_1.version,
42
+ },
47
43
  format: winston_1.format.combine(winston_1.format.timestamp(), winston_1.format.json()),
48
- }));
44
+ transports: [
45
+ new winston_1.transports.Console({
46
+ format: winston_1.format.combine(winston_1.format.timestamp(), winston_1.format.json()),
47
+ }),
48
+ ],
49
+ });
49
50
  }
50
51
  }
51
52
  info(message, ...args) {
@@ -69,6 +70,7 @@ class Logger {
69
70
  this.logger.debug(message, ...args);
70
71
  }
71
72
  setLogLevel(level) {
73
+ this.silent = level === 'none';
72
74
  if ('silent' in this.logger) {
73
75
  this.logger.silent = level === 'none';
74
76
  }
@@ -18,4 +18,4 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.version = void 0;
20
20
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
21
- exports.version = '2.0.0';
21
+ exports.version = '2.0.1';
@@ -23,26 +23,27 @@ export class Logger {
23
23
  constructor({ level = 'info', } = {}) {
24
24
  if (level === 'none') {
25
25
  this.silent = true;
26
- return;
27
26
  }
28
- this.logger = createLogger({
29
- level,
30
- silent: this.silent,
31
- defaultMeta: {
32
- name: 'ar-io-sdk',
33
- version,
34
- },
35
- format: format.combine(format.timestamp(), format.json()),
36
- });
37
27
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38
28
  // @ts-ignore
39
29
  if (typeof window !== 'undefined') {
40
30
  this.logger = console;
41
31
  }
42
32
  else {
43
- this.logger.add(new transports.Console({
33
+ this.logger = createLogger({
34
+ level,
35
+ silent: this.silent,
36
+ defaultMeta: {
37
+ name: 'ar-io-sdk',
38
+ version,
39
+ },
44
40
  format: format.combine(format.timestamp(), format.json()),
45
- }));
41
+ transports: [
42
+ new transports.Console({
43
+ format: format.combine(format.timestamp(), format.json()),
44
+ }),
45
+ ],
46
+ });
46
47
  }
47
48
  }
48
49
  info(message, ...args) {
@@ -66,6 +67,7 @@ export class Logger {
66
67
  this.logger.debug(message, ...args);
67
68
  }
68
69
  setLogLevel(level) {
70
+ this.silent = level === 'none';
69
71
  if ('silent' in this.logger) {
70
72
  this.logger.silent = level === 'none';
71
73
  }
@@ -15,4 +15,4 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
18
- export const version = '2.0.0';
18
+ export const version = '2.0.1';
@@ -14,4 +14,4 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- export declare const version = "2.0.0-alpha.11";
17
+ export declare const version = "2.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"