SkuldNorniern / fluere

Fluere is a powerful and versatile tool designed for network monitoring and analysis. It is capable of capturing network packets in pcap format and converting them into NetFlow data, providing a comprehensive view of network traffic. It also Provides Terminal User Interface.
Apache License 2.0
37 stars 3 forks source link

Modify log.rs to support logging in .log file #44

Closed sweep-ai[bot] closed 1 year ago

sweep-ai[bot] commented 1 year ago

Description

This PR modifies the log.rs file to support logging to a .log file instead of logging to the console. The current implementation only uses the println! macro for logging, which is not suitable for a production environment. The changes include:

Summary

This PR addresses the issue #31 by enhancing the logging system in the Fluere project. The changes allow logs to be written to a .log file instead of the console, making them persistent and easily accessible for debugging and monitoring purposes. The log level can be configured, and each run of the program creates a new log file with a timestamp in the file name.

Fixes #31.


To checkout this PR branch, run the following command in your terminal:

git checkout {pull_request.branch_name}

🎉 Latest mprovements to Sweep:


💡 To get Sweep to edit this pull request, you can:

sweep-ai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is cargo install clippy-sarif sarif-fmt. Here are the relevant lines from the logs:

error[E0507]: cannot move out of `*self` which is behind a shared reference
--> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo_metadata-0.15.4/src/diagnostic.rs:95:24
|
95 | #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
|                        ^^^^^^^^^
|                        |
|                        data moved here
|                        move occurs because `unrecognized` has type `Applicability`, which does not implement the `Copy` trait
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider borrowing here
|
95 | #[derive(Debug, Clone, &Serialize, Deserialize, PartialEq, Eq, Hash)]
|                        +

error[E0507]: cannot move out of `*self` which is behind a shared reference
--> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo_metadata-0.15.4/src/messages.rs:104:24
|
104 | #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
|                        ^^^^^^^^^
|                        |
|                        data moved here
|                        move occurs because `unrecognized` has type `Message`, which does not implement the `Copy` trait
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider borrowing here
|
104 | #[derive(Debug, Clone, &Serialize, Deserialize, PartialEq, Eq, Hash)]
|                        +

For more information about this error, try `rustc --explain E0507`.
error: could not compile `cargo_metadata` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.