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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
27 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
28
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
31 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
32
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
35 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
36
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
39 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
40
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
43 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
44
307
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
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
071eccdff8ea fix java formatting
Carl Byington <carl@five-ten-sg.com>
parents: 284
diff changeset
47 }
273
91a31873c42a start conversion from trilead to ganymed
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
48 }