-
Notifications
You must be signed in to change notification settings - Fork 76
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
base: main
Are you sure you want to change the base?
Add log command #151
Conversation
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()) |
There was a problem hiding this comment.
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)
}
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
}
Kudos, SonarCloud Quality Gate passed!
|
Add log command that will output the Nancy Log to the console
This pull request makes the following changes:
cc @bhamail / @DarthHater