Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log command #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add log command #151

wants to merge 1 commit into from

Conversation

protoworlock69
Copy link
Contributor

Add log command that will output the Nancy Log to the console

This pull request makes the following changes:

@DarthHater
Copy link
Member

This is great, Dahlia!

We need to fix the logger a bit before we can move this forward. Unfortunately the way I wrote the logger makes it wipe the file a bit TOO quickly (when nancy starts up), I can work on that with you and @TheDoroTheExploro pretty soon!

@@ -67,6 +71,12 @@ func main() {
}
}

func printLog() {
file, _ := os.Open(logger.GetLogFileLocation())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check the error here, so an improvement to make would be:

file, err := os.Open(logger.GetLogFileLocation())
if err != nil {
     fmt.Println(err)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur on both of these probably wouldn't hurt to also have some sort of user friendly message along with the raw error that happened.

The log you were looking for wasn't on the pile with the others ¯\_(ツ)_/¯ :)

@@ -67,6 +71,12 @@ func main() {
}
}

func printLog() {
file, _ := os.Open(logger.GetLogFileLocation())
b, _ := ioutil.ReadAll(file)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check the error here, so an improvement to make would be:

b, err := ioutil.ReadAll(file)
if err != nil {
     fmt.Println(err)
}

@DarthHater DarthHater changed the base branch from master to main September 22, 2020 21:45
@sonarcloud
Copy link

sonarcloud bot commented Aug 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants