Fix TdApi.LogStreamFile usage in examples.

GitOrigin-RevId: 25af774fee360bd1071ef911d78e50a25b78372a
This commit is contained in:
levlam 2020-10-03 22:05:55 +03:00
parent e104766de3
commit 62d7423bc3
3 changed files with 3 additions and 3 deletions

View File

@ -216,7 +216,7 @@ namespace TdExample
{ {
// disable TDLib log // disable TDLib log
Td.Client.Execute(new TdApi.SetLogVerbosityLevel(0)); Td.Client.Execute(new TdApi.SetLogVerbosityLevel(0));
if (Td.Client.Execute(new TdApi.SetLogStream(new TdApi.LogStreamFile("tdlib.log", 1 << 27))) is TdApi.Error) if (Td.Client.Execute(new TdApi.SetLogStream(new TdApi.LogStreamFile("tdlib.log", 1 << 27, false))) is TdApi.Error)
{ {
throw new System.IO.IOException("Write access to the current directory is required"); throw new System.IO.IOException("Write access to the current directory is required");
} }

View File

@ -305,7 +305,7 @@ public final class Example {
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
// disable TDLib log // disable TDLib log
Client.execute(new TdApi.SetLogVerbosityLevel(0)); Client.execute(new TdApi.SetLogVerbosityLevel(0));
if (Client.execute(new TdApi.SetLogStream(new TdApi.LogStreamFile("tdlib.log", 1 << 27, true))) instanceof TdApi.Error) { if (Client.execute(new TdApi.SetLogStream(new TdApi.LogStreamFile("tdlib.log", 1 << 27, false))) instanceof TdApi.Error) {
throw new IOError(new IOException("Write access to the current directory is required")); throw new IOError(new IOException("Write access to the current directory is required"));
} }

View File

@ -28,7 +28,7 @@ namespace TdApp
_handler = new MyClientResultHandler(this); _handler = new MyClientResultHandler(this);
Td.Client.Execute(new TdApi.SetLogVerbosityLevel(0)); Td.Client.Execute(new TdApi.SetLogVerbosityLevel(0));
Td.Client.Execute(new TdApi.SetLogStream(new TdApi.LogStreamFile(Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "log"), 1 << 27))); Td.Client.Execute(new TdApi.SetLogStream(new TdApi.LogStreamFile(Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "log"), 1 << 27, false)));
System.Threading.Tasks.Task.Run(() => System.Threading.Tasks.Task.Run(() =>
{ {