Skip to content

Commit

Permalink
feat: xiaoya proxy log output command line
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Aug 2, 2024
1 parent 4a90d02 commit c38b821
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions xiaoya_proxy/src/main/java/com/ddsrem/xiaoya_proxy/Logger.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
package com.ddsrem.xiaoya_proxy;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Logger {
static boolean dbg = false;
static boolean dbg = true;

public static void log(String message, boolean force) {
if(!dbg && !force){
return;
}
String filePath = "/storage/emulated/0/TV/log.txt";
try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath, true))) {
writer.write(message);
writer.newLine();
writer.newLine();
} catch (IOException e) {
System.err.println("Error writing to log file: " + e.getMessage());
}
System.out.println(message);
}

public static void log(String message) {
Expand Down

0 comments on commit c38b821

Please sign in to comment.