lfglabs-dev / api.starknet.quest

starknet.quest rust backend
7 stars 28 forks source link

Replace println by a decent logger #241

Closed Marchand-Nicolas closed 2 months ago

Marchand-Nicolas commented 3 months ago

We want to implement WatchTower for a better logging experience. You can check an example of the implementation here: https://github.com/starknet-id/auto_renew_bot/blob/main/bot/src/logger.rs (Don't hesitate to ask for more) I recommend to reuse this code, and create a logger object using

    let logger = Logger::new();

in src/main.rs and add it in the shared_state so that you can reuse it everywhere.

You might want to try using WatchTower in order to check if your logger is properly working with WatchTower:

Mgonzalez06 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have been working as a full-stack developer for two years. I place a strong emphasis on maintaining clean and organized code, ensuring that best practices are followed throughout the development process. While I haven't used WatchTower before, I'm eager to learn and integrate new tools effectively. First time trying to contribute to the OD Hack. Ready to work and learn new things!

How I plan on tackling this issue

To integrate WatchTower for improved logging, I would start by reviewing the provided example implementation to understand its structure and key components. Next, I would create a logger object using let logger = Logger::new(); in src/main.rs and incorporate it into the shared_state to ensure it can be reused throughout the project.

After setting up the logger, I would conduct tests to verify that it is properly functioning with WatchTower, referencing both the front and back repositories as needed. Throughout the process, I would follow the existing design standards of the application to ensure consistency and maintain code quality.

ScottyDavies commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am front end developer with 6 years experience. i have worked with microsoft on several projects, this will be my first time contributing to the hackathon and i am ready to work

How I plan on tackling this issue

I would approach this issue with following steps Reuse the logger implementation from auto_renew_bot/bot/src/logger.rs. Create a Logger instance in src/main.rs and add it to the shared state. Integrate the logger with the WatchTower front-end and back-end. Test the logger by logging messages and verifying them in the WatchTower interface. Customize the logger as needed for your project.

jrmncos commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a SSR Software Engineer Backend. I already added logger to some APIs written in Rust

How I plan on tackling this issue

I will use the code proposed and I will try to replace all print references with that. I will take a look to WatchTower associated code.

PoulavBhowmick03 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm Poulav Bhowmick, a software engineer at Invisible Studios with a robust background in TypeScript, Rust, Solidity Cairo, fullstack development and blockchain technology. My experience includes building robust applications, optimizing functionalities and blockchain integration. I have actively participated in events and open source contributions, enhancing my capability to tackle real-world tech challenges. My projects can be viewed on my GitHub Profile and OnlyDust Profile. Plus I´m active member of Starknet community. Moreover, I have already contributed to this repository, so I have a pretty decent idea and knowledge of the codebase

How I plan on tackling this issue

To implement the WatchTower logger based on the provided example, here's how I would approach the problem:

1. Review the Current Codebase

2. Set Up Configuration

3. Implement the Logger in main.rs

4. Refactor Existing Code to Use Logger

5. Test Logging with WatchTower

ETA- 2 days

DiegoB1911 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a Full Stack Developer with two years of experience. I'm also a member of Dojo Coding, where I'm learning new things such as Cairo and Web3. This is my first time participating in an OD Hack, and I'm eager to learn and contribute to new projects.

How I plan on tackling this issue

To implement WatchTower for improved logging in the project, I would do this: Review and Understand the Example Implementation Implement the Logger in main.rs Test the Logger with WatchTower Final Review

onlydustapp[bot] commented 2 months ago

The maintainer Marchand-Nicolas has assigned coxmars to this issue via OnlyDust Platform. Good luck!

Oshioke-Salaki commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello my name is Oshioke Salaki and i am a proficient Frontend developer and web3 developer. My background in such fields gives an experience that is unmatched. You can trust that i will be efficient in solving this issue in the best way i can in the shortest possible time.

How I plan on tackling this issue

To solve this issue, I’d: 1.⁠ ⁠I’ll check the logger implementation in the auto_renew_bot repository. 2.⁠ ⁠⁠I’ll reuse the logger code in your project by creating a logger.rs file. I’ll now initialize the logger in src/main.rs with let logger = Logger::new();. I’ll then add the logger to your shared_state for global access. 3.⁠ ⁠I’ll set up the WatchTower backend using the watchtower_server repository. I can optionally set up the frontend for real-time log visualization using the watchtower.starknet.id repository. 4.⁠ ⁠⁠Lastly, I’ll run the application, generate logs, and ensure they are correctly sent to and displayed by WatchTower.

Please assign this issue to me, I’ll start immediately.

SoarinSkySagar commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a web3 developer with experience of over a year in working with blockchain technologies. I have experience in writing rust code and also contributing to rust repositories, including blockchain repos. In fact, I have already successfully contributed to this Starknet Quest before on an issue in the api.starknet.quest repository.

How I plan on tackling this issue

After going through the example of the WatchTower logger, here is how I would approach this issue:

  1. Go through the main.rs file to thoroughly understand the current codebase
  2. Create a config.rs file to setup WatchTower
  3. Replace the existing println loggers with the WatchTower logger after instantiating it
  4. Run the codebase and test the WatchTower functionality, and ensure that there are no errors. Add comments wherever required so that new devs can understand the code

Since I have already worked on this repo before, I already have a good idea of the codebase and can ensure that this issue will be resolved successfully. My ETA for this issue is 3±1 days.

diegoTech14 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @Marchand-Nicolas I'm Diego Duarte Fernández from Costa Rica and Dojo Coding member this is my OnlyDust profile: https://app.onlydust.com/u/diegoTech14, I would love to help with this issue.

I'm a software developer I have experience with languages like JS, Java, C# and also I've contributed to OSS through OnlyDust.

How I plan on tackling this issue

1. Understand the current logging system:

   I will start reviewing the current implementation of the logging system

2. WatchTower:

   I will analyze the current WatchTower implementation and the WatchTower documentation to understand its setup.

3. Design :

   I will design a logging system that leverages WatchTower, this includes create a logger object fulfilling the requirements above

4. New println statements:

   I will replace all println statements with correct logger calls.

Thanks for the consideration.

Best regards,

Diego Duarte Fernández

mamicho16 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I’m a software developer with over 2 years of experience working with Java, C#, Dart, and Rust. This will be my first time contributing to the ODHack, and I'm excited to bring my skills and experience to the table.

How I plan on tackling this issue

To implement WatchTower for improved logging, I would proceed with the following steps:

Understand the Current Logging Setup: Begin by reviewing the existing println statements throughout the codebase to understand where and how logging is currently implemented.

Study WatchTower Implementation: I will thoroughly review the provided example of the WatchTower logger implementation and examine the documentation for both the WatchTower front-end and back-end to grasp its setup and best practices.

Design and Implement the New Logging System:

I will reuse the logger implementation from auto_renew_bot/bot/src/logger.rs. Create a Logger instance in src/main.rs using let logger = Logger::new(); and integrate it into the shared state to ensure it's accessible throughout the project. Systematically replace all println statements with appropriate logger calls to ensure that the logging is consistent and aligned with best practices. Integration with WatchTower:

I will connect the logger with the WatchTower front-end and back-end systems. Test the logger by logging various messages and verifying that they appear correctly within the WatchTower interface. Customization and Documentation: Customize the logger as necessary to fit the specific needs of the project and submit a pull request that includes a detailed description of the changes along with documentation on how to use and maintain the new logging system.

martinvibes commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i'm a frontend and blockchain developer

How I plan on tackling this issue

Review the project structure and current println usage.

Implement the WatchTower logger by reusing code from the provided example.

Create a logger object in src/main.rs and integrate it into shared_state. Replace all println statements with the new logger.

Test the logger integration using WatchTower. Refactor and optimize the code as needed. Document the changes and provide instructions for using the logger with WatchTower.

onlydustapp[bot] commented 2 months ago

The maintainer Marchand-Nicolas has assigned coxmars to this issue via OnlyDust Platform. Good luck!

onlydustapp[bot] commented 2 months ago

The maintainer Marchand-Nicolas has assigned Oshioke-Salaki to this issue via OnlyDust Platform. Good luck!

DIWAKARKASHYAP commented 2 months ago

i want to work on this issue