Mercurial > 510Connectbot
annotate app/src/main/java/ch/ethz/ssh2/log/Logger.java @ 461:8ac203bbd3c2
Added tag stable-1.9.3-4 for changeset 4776062555f3
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 28 Apr 2019 17:10:22 -0700 |
parents | d29cce60f393 |
children |
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"; |
377
4226f87534f4
remove hmac-sha2-512 - fails interop w/ centos6
Carl Byington <carl@five-ten-sg.com>
parents:
376
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 } |