mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-22 04:30:17 +01:00
Make TDLib log output easily
This commit is contained in:
parent
b2327b9644
commit
469cae3b44
1 changed files with 12 additions and 16 deletions
|
|
@ -37,24 +37,20 @@ func WithProxy(req *AddProxyRequest) Option {
|
|||
}
|
||||
}
|
||||
|
||||
func SetLogVerbosityLevel(level int32) Option {
|
||||
return func(client *Client) {
|
||||
client.SetLogVerbosityLevel(&SetLogVerbosityLevelRequest{
|
||||
NewVerbosityLevel: level,
|
||||
})
|
||||
}
|
||||
func SetLogLevel(level int32) {
|
||||
_, _ = SetLogVerbosityLevel(&SetLogVerbosityLevelRequest{
|
||||
NewVerbosityLevel: level,
|
||||
})
|
||||
}
|
||||
|
||||
func SetFilePath(path string) Option {
|
||||
return func(client *Client) {
|
||||
client.SetLogStream(&SetLogStreamRequest{
|
||||
LogStream: &LogStreamFile{
|
||||
Path: path,
|
||||
MaxFileSize: 10485760,
|
||||
RedirectStderr: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
func SetFilePath(path string) {
|
||||
_, _ = SetLogStream(&SetLogStreamRequest{
|
||||
LogStream: &LogStreamFile{
|
||||
Path: path,
|
||||
MaxFileSize: 10485760,
|
||||
RedirectStderr: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func NewClient(authorizationStateHandler AuthorizationStateHandler, options ...Option) (*Client, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue