deprecated functions
This commit is contained in:
parent
b1c8b7a754
commit
7f5ecc75f7
42
README.md
42
README.md
|
@ -4,36 +4,7 @@ Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td)
|
||||||
|
|
||||||
## TDLib installation
|
## TDLib installation
|
||||||
|
|
||||||
### Ubuntu 18.04 / Debian 9
|
### Ubuntu 18-19 / Debian 9
|
||||||
|
|
||||||
#### Precompiled (v1.3.0)
|
|
||||||
|
|
||||||
Debian:
|
|
||||||
```bash
|
|
||||||
su
|
|
||||||
apt update
|
|
||||||
apt install -y apt-transport-https curl gnupg
|
|
||||||
curl "https://repo.zelenin.pw/gpg.key" | apt-key add -
|
|
||||||
echo "deb [arch=amd64] https://repo.zelenin.pw common contrib" | tee "/etc/apt/sources.list.d/tdlib.list"
|
|
||||||
apt update
|
|
||||||
apt install -y tdlib-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Ubuntu:
|
|
||||||
```bash
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y apt-transport-https curl gnupg
|
|
||||||
curl "https://repo.zelenin.pw/gpg.key" | sudo apt-key add -
|
|
||||||
echo "deb [arch=amd64] https://repo.zelenin.pw common contrib" | sudo tee "/etc/apt/sources.list.d/tdlib.list"
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y tdlib-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Fedora:
|
|
||||||
```bash
|
|
||||||
sudo dnf update
|
|
||||||
sudo dnf install tdlib-static
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Manual compilation
|
#### Manual compilation
|
||||||
|
|
||||||
|
@ -73,10 +44,15 @@ import (
|
||||||
|
|
||||||
"github.com/zelenin/go-tdlib/client"
|
"github.com/zelenin/go-tdlib/client"
|
||||||
)
|
)
|
||||||
|
func WithLogs() client.Option {
|
||||||
|
return func(tdlibClient *client.Client) {
|
||||||
|
tdlibClient.SetLogVerbosityLevel(&client.SetLogVerbosityLevelRequest{
|
||||||
|
NewVerbosityLevel: 1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
client.SetLogVerbosityLevel(1)
|
|
||||||
|
|
||||||
// client authorizer
|
// client authorizer
|
||||||
authorizer := client.ClientAuthorizer()
|
authorizer := client.ClientAuthorizer()
|
||||||
go client.CliInteractor(authorizer)
|
go client.CliInteractor(authorizer)
|
||||||
|
@ -108,7 +84,7 @@ func main() {
|
||||||
IgnoreFileNames: false,
|
IgnoreFileNames: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
tdlibClient, err := client.NewClient(authorizer)
|
tdlibClient, err := client.NewClient(authorizer, WithLogs())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("NewClient error: %s", err)
|
log.Fatalf("NewClient error: %s", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,7 @@ func (jsonClient *JsonClient) Destroy() {
|
||||||
// Sets the path to the file where the internal TDLib log will be written.
|
// Sets the path to the file where the internal TDLib log will be written.
|
||||||
// By default TDLib writes logs to stderr or an OS specific log.
|
// By default TDLib writes logs to stderr or an OS specific log.
|
||||||
// Use this method to write the log to a file instead.
|
// Use this method to write the log to a file instead.
|
||||||
|
// Deprecated
|
||||||
func SetLogFilePath(filePath string) {
|
func SetLogFilePath(filePath string) {
|
||||||
query := C.CString(filePath)
|
query := C.CString(filePath)
|
||||||
defer C.free(unsafe.Pointer(query))
|
defer C.free(unsafe.Pointer(query))
|
||||||
|
@ -106,12 +107,14 @@ func SetLogFilePath(filePath string) {
|
||||||
|
|
||||||
// Sets maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated.
|
// Sets maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated.
|
||||||
// Unused if log is not written to a file. Defaults to 10 MB.
|
// Unused if log is not written to a file. Defaults to 10 MB.
|
||||||
|
// Deprecated
|
||||||
func SetLogMaxFileSize(maxFileSize int64) {
|
func SetLogMaxFileSize(maxFileSize int64) {
|
||||||
C.td_set_log_max_file_size(C.longlong(maxFileSize))
|
C.td_set_log_max_file_size(C.longlong(maxFileSize))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets the verbosity level of the internal logging of TDLib.
|
// Sets the verbosity level of the internal logging of TDLib.
|
||||||
// By default the TDLib uses a log verbosity level of 5
|
// By default the TDLib uses a log verbosity level of 5
|
||||||
|
// Deprecated
|
||||||
func SetLogVerbosityLevel(newVerbosityLevel int) {
|
func SetLogVerbosityLevel(newVerbosityLevel int) {
|
||||||
C.td_set_log_verbosity_level(C.int(newVerbosityLevel))
|
C.td_set_log_verbosity_level(C.int(newVerbosityLevel))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue