Skip to content

Commit

Permalink
Change default verbosity level to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
eilvelia committed May 8, 2024
1 parent 39a532f commit aaad4b6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
returning the object.
- The TDLib errors are now wrapped in a new `TDLibError` class; `TdlError`
is removed and replaced with `UnknownError`.
- Changed the default verbosity level from 2 to 1.
- Removed deprecated client options: `receiveTimeout`, `useDefaultVerbosityLevel`,
`disableAuth`, `useMutableRename`, `verbosityLevel`.
- Removed the `bare` client option. `tdl.createBareClient(): Client` is added
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Some short examples are available in the [examples/](examples/) directory.
#### `tdl.configure(options: TDLibConfiguration) => void`

Configure several parameters such as libtdjson name or verbosity level. This
Configure several parameters such as libtdjson filename or verbosity level. This
function should be called before `tdl.createClient` or `tdl.execute`.

The possible parameters are:
Expand All @@ -156,8 +156,8 @@ tdl.configure({
tdjson: 'libtdjson.so',
// Path to the library directory. Defaults to the empty string.
libdir: '/usr/local/lib',
// Set the verbosity level of TDLib. Defaults to 2.
verbosityLevel: 3,
// Set the verbosity level of TDLib. Defaults to 1.
verbosityLevel: 1,
// Advanced options:
useOldTdjsonInterface: false,
receiveTimeout: 10,
Expand Down
2 changes: 0 additions & 2 deletions examples/get-chats.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const tdl = require('tdl')

tdl.configure({ verbosityLevel: 1 })

const client = tdl.createClient({
apiId: 2222, // Your api_id
apiHash: 'YOUR_API_HASH'
Expand Down
20 changes: 13 additions & 7 deletions packages/tdl/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ export type TDLibConfiguration = {
*/
libdir?: string,
/**
* Set the verbosity level of TDLib. From the TDLib documentation: "value 0
* corresponds to fatal errors, value 1 corresponds to errors, value 2
* corresponds to warnings and debug warnings, value 3 corresponds to
* informational, value 4 corresponds to debug, value 5 corresponds to verbose
* debug, value greater than 5 and up to 1024 can be used to enable even more
* logging". Another possible option is `'default'`, `tdl` will then not send
* any verbosity level to TDLib. Defaults to `2`.
* Set the verbosity level of TDLib. Defaults to `1`. From the TDLib
* documentation:
* - 0 corresponds to fatal errors,
* - 1 corresponds to errors,
* - 2 corresponds to warnings and debug warnings,
* - 3 corresponds to informational,
* - 4 corresponds to debug,
* - 5 corresponds to verbose deubg,
* - value greater than 5 and up to 1024 can be used to enable even more
* logging.
*
* Another possible option is `'default'`, `tdl` then won't send any
* verbosity level to TDLib.
*/
verbosityLevel?: number | 'default',
/**
Expand Down
20 changes: 13 additions & 7 deletions packages/tdl/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ export type TDLibConfiguration = {
*/
libdir?: string,
/**
* Set the verbosity level of TDLib. From the TDLib documentation: "value 0
* corresponds to fatal errors, value 1 corresponds to errors, value 2
* corresponds to warnings and debug warnings, value 3 corresponds to
* informational, value 4 corresponds to debug, value 5 corresponds to verbose
* debug, value greater than 5 and up to 1024 can be used to enable even more
* logging". Another possible option is `'default'`, `tdl` will then not send
* any verbosity level to TDLib. Defaults to `2`.
* Set the verbosity level of TDLib. Defaults to `1`. From the TDLib
* documentation:
* - 0 corresponds to fatal errors,
* - 1 corresponds to errors,
* - 2 corresponds to warnings and debug warnings,
* - 3 corresponds to informational,
* - 4 corresponds to debug,
* - 5 corresponds to verbose deubg,
* - value greater than 5 and up to 1024 can be used to enable even more
* logging.
*
* Another possible option is `'default'`, `tdl` will then not send any
* verbosity level to TDLib.
*/
verbosityLevel?: number | 'default',
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/tdl/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type TDLibConfiguration = {
const cfg: Required<TDLibConfiguration> = {
tdjson: defaultLibraryFile,
libdir: '',
verbosityLevel: 2,
verbosityLevel: 1,
receiveTimeout: 10,
useOldTdjsonInterface: false
}
Expand Down

0 comments on commit aaad4b6

Please sign in to comment.