@ar.io/sdk 2.0.0-alpha.2 → 2.0.0-alpha.4

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/README.md CHANGED
@@ -42,6 +42,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
42
42
  - [Configuration](#custom-configuration)
43
43
 
44
44
  - [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
45
+
45
46
  - [ANT APIs](#ant-apis)
46
47
  - [`init({ signer})`](#init-signer-)
47
48
  - [`getInfo()`](#getinfo)
@@ -56,6 +57,11 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
56
57
  - [`setName({ name })`](#setname-name-)
57
58
  - [`setTicker({ ticker })`](#setticker-ticker-)
58
59
  - [Configuration](#configuration)
60
+
61
+ - [Logging](#logging)
62
+
63
+ - [Configuration](#configuration)
64
+
59
65
  - [Developers](#developers)
60
66
  - [Requirements](#requirements)
61
67
  - [Setup \& Build](#setup--build)
@@ -1136,6 +1142,22 @@ const ant = ANT.init({
1136
1142
  });
1137
1143
  ```
1138
1144
 
1145
+ ## Logging
1146
+
1147
+ The library uses the [Winston] logger for node based projects, and `console` logger for web based projects by default. You can configure the log level via `setLogLevel()` API. Alternatively you can set a custom logger as the default logger so long as it satisfes the `ILogger` interface.
1148
+
1149
+ ### Configuration
1150
+
1151
+ ```typescript
1152
+ import { Logger } from '@ar.io/sdk';
1153
+
1154
+ // set the log level
1155
+ Logger.default.setLogLevel('debug');
1156
+
1157
+ // provide your own logger
1158
+ Logger.default = winston.createLogger({ ...loggerConfigs }); // or some other logger that satisifes ILogger interface
1159
+ ```
1160
+
1139
1161
  ## Developers
1140
1162
 
1141
1163
  ### Requirements
@@ -1184,3 +1206,4 @@ For more information on how to contribute, please see [CONTRIBUTING.md].
1184
1206
  [AO Connect]: https://github.com/permaweb/ao/tree/main/connect
1185
1207
  [IO testnet process]: https://www.ao.link/#/entity/agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA
1186
1208
  [IO Network spec]: https://github.com/ar-io/ar-io-network-process?tab=readme-ov-file#contract-spec
1209
+ [Winston]: https://www.npmjs.com/package/winston