Make TDLib log output easily
This commit is contained in:
parent
b2327b9644
commit
469cae3b44
|
@ -37,24 +37,20 @@ func WithProxy(req *AddProxyRequest) Option {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetLogVerbosityLevel(level int32) Option {
|
func SetLogLevel(level int32) {
|
||||||
return func(client *Client) {
|
_, _ = SetLogVerbosityLevel(&SetLogVerbosityLevelRequest{
|
||||||
client.SetLogVerbosityLevel(&SetLogVerbosityLevelRequest{
|
NewVerbosityLevel: level,
|
||||||
NewVerbosityLevel: level,
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetFilePath(path string) Option {
|
func SetFilePath(path string) {
|
||||||
return func(client *Client) {
|
_, _ = SetLogStream(&SetLogStreamRequest{
|
||||||
client.SetLogStream(&SetLogStreamRequest{
|
LogStream: &LogStreamFile{
|
||||||
LogStream: &LogStreamFile{
|
Path: path,
|
||||||
Path: path,
|
MaxFileSize: 10485760,
|
||||||
MaxFileSize: 10485760,
|
RedirectStderr: true,
|
||||||
RedirectStderr: true,
|
},
|
||||||
},
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClient(authorizationStateHandler AuthorizationStateHandler, options ...Option) (*Client, error) {
|
func NewClient(authorizationStateHandler AuthorizationStateHandler, options ...Option) (*Client, error) {
|
||||||
|
|
Loading…
Reference in a new issue