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

Custom Logger Code Review #4

Merged
merged 9 commits into from
Mar 6, 2018
Merged

Conversation

ftcgearedup
Copy link
Owner

This code adds a custom, customizable logger that comes with the ability to write to any file,

Copy link
Owner Author

@ftcgearedup ftcgearedup left a comment

Choose a reason for hiding this comment

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

reformat code using android studios, add log tags and time stamps, log levels.


public class TeamLog {
File logFile = new File("sdcard/log.file");
public void appendLog(String text, String fileName)
Copy link
Owner Author

Choose a reason for hiding this comment

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

add java docs to methods.

import java.io.IOException;
import java.io.PrintWriter;

/**
Copy link
Owner Author

Choose a reason for hiding this comment

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

replace with real java docs

{
try
{
logFile.createNewFile();
Copy link
Owner Author

Choose a reason for hiding this comment

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

test making a file to another folder

catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
Copy link
Owner Author

Choose a reason for hiding this comment

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

test for phone exception. create uncreatable file

}

}
// clear the file
Copy link
Owner Author

Choose a reason for hiding this comment

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

change to java doc

}
}


Copy link
Owner Author

Choose a reason for hiding this comment

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

delete extra spaces

/**
* @param text the text that you want the log message displays.
* @param tag the tag is attacjhed to the log message and is used to filter log messages by type.
*/
Copy link
Owner Author

Choose a reason for hiding this comment

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

describe what append log does

if (!file.exists())
{
try
{
Copy link
Owner Author

Choose a reason for hiding this comment

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

reformat on android studios

writer.print("");
writer.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
Copy link
Owner Author

Choose a reason for hiding this comment

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

log this stack trace
make a constant for the log tag TEAM LOG

* @param text the text that you want the log message displays.
* @param tag the tag is attacjhed to the log message and is used to filter log messages by type.
*/
public void appendLog(String text, String tag) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

accept a date format

… work, created a constant for the log tag for errors in the log itself, added more detailed java docs.
…d with LiveGraph. the file Data Gram Log was created and loggs to a UDP stream on port 6347.
@ftcgearedup ftcgearedup merged commit 8c29e71 into beta Mar 6, 2018
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.

2 participants