Mercurial > 510Connectbot
annotate src/ch/ethz/ssh2/log/Logger.java @ 369:7a5943a514d5
debug kex error
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 04 Aug 2014 11:39:58 -0700 |
parents | adab27dd4598 |
children | f4d595402a2f |
rev | line source |
---|---|
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
1 /* |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved. |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
3 * Please refer to the LICENSE.txt for licensing details. |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
4 */ |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
5 |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
6 package ch.ethz.ssh2.log; |
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
7 |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
8 import android.util.Log; |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
9 |
307 | 10 public class Logger { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
11 private static final String TAG = "ConnectBot.ssh"; |
355
adab27dd4598
remove ssh debug logging
Carl Byington <carl@five-ten-sg.com>
parents:
333
diff
changeset
|
12 public static boolean enabled = false; |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
13 |
307 | 14 public static Logger getLogger(Class<?> x) { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
15 return new Logger(); |
307 | 16 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
17 |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
18 public Logger() { |
307 | 19 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
20 |
284
4ec87de11e71
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
273
diff
changeset
|
21 public final boolean isEnabled() { |
4ec87de11e71
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
273
diff
changeset
|
22 return enabled; |
4ec87de11e71
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
273
diff
changeset
|
23 } |
4ec87de11e71
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
273
diff
changeset
|
24 |
307 | 25 public boolean isDebugEnabled() { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
26 return enabled; |
307 | 27 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
28 |
307 | 29 public void debug(String message) { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
30 if (enabled) Log.d(TAG, message); |
307 | 31 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
32 |
307 | 33 public boolean isInfoEnabled() { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
34 return enabled; |
307 | 35 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
36 |
307 | 37 public void info(String message) { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
38 if (enabled) Log.i(TAG, message); |
307 | 39 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
40 |
307 | 41 public boolean isWarningEnabled() { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
42 return enabled; |
307 | 43 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
44 |
307 | 45 public void warning(String message) { |
333
d835e842d158
still hangs during connection
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
46 if (enabled) Log.w(TAG, message); |
307 | 47 } |
273
91a31873c42a
start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
48 } |