Skip to content

Commit

Permalink
less stuff on stdout
Browse files Browse the repository at this point in the history
ERRR don't get printed on stdout.
Shorter headers on stdout.
  • Loading branch information
janvitek committed Apr 26, 2013
1 parent 7092422 commit 1bb50c1
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 113 deletions.
24 changes: 12 additions & 12 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
Expand Down Expand Up @@ -161,7 +161,7 @@ org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=true
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
Expand All @@ -188,13 +188,13 @@ org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_ini
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
Expand Down Expand Up @@ -356,16 +356,16 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_decla
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
org.eclipse.jdt.core.formatter.lineSplit=120
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.use_on_off_tags=true
Expand Down
25 changes: 22 additions & 3 deletions src/main/java/water/Timer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
/**
* Simple Timer class.
**/
public class Timer {

/** SimpleDataFormat is not thread safe. To avoid constructing them repeatedly we store them into thread
* local variables. */
private static final ThreadLocal<SimpleDateFormat> utcFormat = new ThreadLocal<SimpleDateFormat>() {
@Override protected SimpleDateFormat initialValue() {
SimpleDateFormat format = new SimpleDateFormat("dd-MMM hh:mm:ss.SSS");
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format;
}
};
private static final ThreadLocal<SimpleDateFormat> utcShortFormat = new ThreadLocal<SimpleDateFormat>() {
@Override protected SimpleDateFormat initialValue() {
SimpleDateFormat format = new SimpleDateFormat("hh:mm:ss");
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format;
}
};

public final long _start = System.currentTimeMillis();

/**Return the difference between when the timer was created and the current time. */
Expand All @@ -16,11 +34,12 @@ public class Timer {
* string along with the time of creation in date format. */
public String toString() {
final long now = System.currentTimeMillis();
return PrettyPrint.msecs(now - _start, false) + " (Wall clock time: " +
new SimpleDateFormat("dd-MMM hh:mm").format(new Date(now)) + ") ";
return PrettyPrint.msecs(now - _start, false) + " (Wall: " + utcFormat.get().format(new Date(now)) + ") ";
}

/** return the start time of this timer.**/
public String startAsString() { return new SimpleDateFormat("[dd-MMM hh:mm:ss:SSS]").format(new Date(_start)); }
public String startAsString() { return utcFormat.get().format(new Date(_start)); }
/** return the start time of this timer.**/
public String startAsShortString() { return utcShortFormat.get().format(new Date(_start)); }

}
2 changes: 1 addition & 1 deletion src/main/java/water/TypeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class TypeMap {
"water.Key",
"water.Key$Ary",
"water.util.Log$LogStr",
"water.util.Log$Wrapper$1",
"water.util.Log$1",
"water.MRTask",
"water.Model",
"water.NOPTask",
Expand Down
Loading

0 comments on commit 1bb50c1

Please sign in to comment.