-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.java
More file actions
44 lines (39 loc) · 1.11 KB
/
Logger.java
File metadata and controls
44 lines (39 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package org.scotsbots.robotbase.utils;
import java.util.Calendar;
/**
* This used to do cool stuff. Now it just logs.
* @author Howell Robotics
*
*/
public class Logger
{
/**
* Writes a formatted message to the 'Riolog' in eclipse.
* @param contents contents to print
* @param isErr should this be red or not
*/
public static void riolog(String contents, boolean isErr)
{
if(isErr)
System.err.println("[ERRLog] [" + Calendar.MINUTE + "mi " + Calendar.SECOND + "sec " + Calendar.MILLISECOND + "ms] " + contents);
else
System.out.println("[Log] [" + Calendar.MINUTE + "mi " + Calendar.SECOND + "sec " + Calendar.MILLISECOND + "ms] " + contents);
}
/**
* Writes a formatted message to the 'Riolog' in eclipse.
* @param contents contents to print
*/
public static void riolog(String contents)
{
riolog(contents, false);
}
/**
* Writes a formatted message to the 'Riolog' in eclipse.
* @param contents contents to print
* @param e stacktrace of exception to print
*/
public static void riolog(String contents, Exception e)
{
riolog(contents, true);
e.printStackTrace();
}}