-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
solnicki
committed
Nov 8, 2024
1 parent
487c905
commit 86d7d35
Showing
31 changed files
with
444 additions
and
983 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package logveil | ||
|
||
import ( | ||
"bufio" | ||
"log/slog" | ||
|
||
"github.com/logmanager-oss/logveil/internal/anonymizer" | ||
"github.com/logmanager-oss/logveil/internal/flags" | ||
"github.com/logmanager-oss/logveil/internal/loader" | ||
"github.com/logmanager-oss/logveil/internal/runner" | ||
) | ||
|
||
func Run() { | ||
slog.Info("Anonymization process started...") | ||
|
||
anonymizingDataDir, input, output, isLmExport := flags.Load() | ||
defer input.Close() | ||
defer output.Close() | ||
|
||
anonymizingData, err := loader.Load(anonymizingDataDir) | ||
if err != nil { | ||
slog.Error("loading anonymizing data from dir %s: %v", anonymizingDataDir, err) | ||
return | ||
} | ||
anonymizer := anonymizer.New(anonymizingData) | ||
|
||
outputWriter := bufio.NewWriter(output) | ||
defer outputWriter.Flush() | ||
|
||
if isLmExport { | ||
err := runner.AnonymizeLmExport(input, outputWriter, anonymizer) | ||
if err != nil { | ||
slog.Error("reading lm export input file %s: %v", input.Name(), err) | ||
return | ||
} | ||
} else { | ||
err := runner.AnonymizeLmBackup(input, outputWriter, anonymizer) | ||
if err != nil { | ||
slog.Error("reading lm backup input file %s: %v", input.Name(), err) | ||
return | ||
} | ||
} | ||
|
||
slog.Info("All done. Exiting...") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package main | ||
|
||
import "github.com/logmanager-oss/logveil/internal/anonymizer" | ||
import "github.com/logmanager-oss/logveil/cmd/logveil" | ||
|
||
func main() { | ||
anonymizer.Run() | ||
logveil.Run() | ||
} |
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.