-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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.
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) |
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.
add java docs to methods.
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
|
||
/** |
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.
replace with real java docs
{ | ||
try | ||
{ | ||
logFile.createNewFile(); |
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.
test making a file to another folder
catch (IOException e) | ||
{ | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); |
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.
test for phone exception. create uncreatable file
} | ||
|
||
} | ||
// clear the 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.
change to java doc
} | ||
} | ||
|
||
|
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.
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. | ||
*/ |
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.
describe what append log does
if (!file.exists()) | ||
{ | ||
try | ||
{ |
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.
reformat on android studios
writer.print(""); | ||
writer.close(); | ||
} catch (FileNotFoundException e) { | ||
e.printStackTrace(); |
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.
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) { |
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.
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.
This code adds a custom, customizable logger that comes with the ability to write to any file,