colorstackatuw / ColorStack-Discord-Bot

Discord bot created by ColorStack at UW-Madison to track and post internship opportunities within your Discord
https://colorstack.cs.wisc.edu
MIT License
7 stars 3 forks source link

Create better docker logging system #3

Closed DavidSalazar123 closed 9 months ago

DavidSalazar123 commented 10 months ago

Is your feature request related to a problem? Please describe.

None

Describe the solution you'd like

Creating a better and more descriptive logging system within the src/DiscordBot.py would benefit any issues encountered when attempting to debug the container.

Describe alternatives you've considered

Adding print statements to the 1 minute tasks about what task is running and what are the results from it Adding print statements to signal that the task as started

Suggestions

Could create a separate logging class that can be applied to all methods

Additional context

Would recommend putting these print statements somewhere in between here:

try:
        channel = bot.get_channel(int(CHANNEL_ID))  # Replace with your channel ID
        github_utilitiles = GitHubUtilities(
            token=GITHUB_TOKEN,
            repo_name="SimplifyJobs/Summer2024-Internships",
        )
        repo = github_utilitiles.createGitHubConnection()
        last_saved_commit = github_utilitiles.getCommitLinks()

        internship_utilities = InternshipUtilities(repo, summer=True, co_op=True)

        if github_utilitiles.isNewCommit(repo, last_saved_commit):
            if internship_utilities.isSummer:
                await internship_utilities.getSummerInternships(channel)
            if internship_utilities.isCoop:
                await internship_utilities.getCoopInternships(channel)
            github_utilitiles.setNewCommit(github_utilitiles.getLastCommit(repo))
        else:
            print("No new jobs! Time: ", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))