Make TDLib log output easily

This commit is contained in:
c0re100 2022-01-27 13:41:34 +08:00
parent 6ae3f83566
commit a0548a12c7
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF

View file

@ -37,9 +37,23 @@ func WithProxy(req *AddProxyRequest) Option {
} }
} }
func WithLogVerbosity(req *SetLogVerbosityLevelRequest) Option { func SetLogVerbosityLevel(level int32) Option {
return func(client *Client) { return func(client *Client) {
client.SetLogVerbosityLevel(req) client.SetLogVerbosityLevel(&SetLogVerbosityLevelRequest{
NewVerbosityLevel: level,
})
}
}
func SetFilePath(path string) Option {
return func(client *Client) {
client.SetLogStream(&SetLogStreamRequest{
LogStream: &LogStreamFile{
Path: path,
MaxFileSize: 10485760,
RedirectStderr: true,
},
})
} }
} }