Reformat files using Android Studio
android-studio/bin/format.sh -m '*.java' -r brouter-routing-app
To rebase active branches on top of the new master just rebase your
branch onto the commit prior to the reformatting and format every commit
of your branch using (<commit> should be replaced by this commit)
git rebase \
--strategy-option=theirs \
--onto <commit> \
--exec 'format.sh -m "*.java" -r brouter-routing-app' \
--exec 'git commit --all --no-edit --amend' \
<commit>~
To ignore this mass edit during git blame see `.git-blame-ignore-revs`
This commit is contained in:
parent
13e0e382c1
commit
54d5c5e943
18 changed files with 3025 additions and 3662 deletions
|
|
@ -13,70 +13,58 @@ import android.os.Environment;
|
|||
/**
|
||||
* static logger interface to be used in the android app
|
||||
*/
|
||||
public class AppLogger
|
||||
{
|
||||
private static FileWriter debugLogWriter = null;
|
||||
private static boolean initDone = false;
|
||||
|
||||
private static void init()
|
||||
{
|
||||
try
|
||||
{
|
||||
// open logfile if existing
|
||||
File sd = Environment.getExternalStorageDirectory();
|
||||
if ( sd == null ) return;
|
||||
File debugLog = new File( sd, "Android/media/btools.routingapp/brouter/brouterapp.txt" );
|
||||
if ( debugLog.exists() )
|
||||
{
|
||||
debugLogWriter = new FileWriter( debugLog, true );
|
||||
}
|
||||
public class AppLogger {
|
||||
private static FileWriter debugLogWriter = null;
|
||||
private static boolean initDone = false;
|
||||
|
||||
private static void init() {
|
||||
try {
|
||||
// open logfile if existing
|
||||
File sd = Environment.getExternalStorageDirectory();
|
||||
if (sd == null) return;
|
||||
File debugLog = new File(sd, "Android/media/btools.routingapp/brouter/brouterapp.txt");
|
||||
if (debugLog.exists()) {
|
||||
debugLogWriter = new FileWriter(debugLog, true);
|
||||
}
|
||||
catch( IOException ioe ) {}
|
||||
} catch (IOException ioe) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* log an info trace to the app log file, if any
|
||||
*/
|
||||
public static boolean isLogging()
|
||||
{
|
||||
if ( !initDone )
|
||||
{
|
||||
initDone = true;
|
||||
init();
|
||||
log( "logging started at " + new Date() );
|
||||
}
|
||||
return debugLogWriter != null;
|
||||
/**
|
||||
* log an info trace to the app log file, if any
|
||||
*/
|
||||
public static boolean isLogging() {
|
||||
if (!initDone) {
|
||||
initDone = true;
|
||||
init();
|
||||
log("logging started at " + new Date());
|
||||
}
|
||||
return debugLogWriter != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* log an info trace to the app log file, if any
|
||||
*/
|
||||
public static void log( String msg )
|
||||
{
|
||||
if ( isLogging() )
|
||||
{
|
||||
try
|
||||
{
|
||||
debugLogWriter.write( msg );
|
||||
debugLogWriter.write( '\n' );
|
||||
debugLogWriter.flush();
|
||||
}
|
||||
catch( IOException e )
|
||||
{
|
||||
throw new RuntimeException( "cannot write brouterapp.txt: " + e );
|
||||
}
|
||||
/**
|
||||
* log an info trace to the app log file, if any
|
||||
*/
|
||||
public static void log(String msg) {
|
||||
if (isLogging()) {
|
||||
try {
|
||||
debugLogWriter.write(msg);
|
||||
debugLogWriter.write('\n');
|
||||
debugLogWriter.flush();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("cannot write brouterapp.txt: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format an exception using
|
||||
*/
|
||||
public static String formatThrowable( Throwable t )
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter( sw );
|
||||
t.printStackTrace( pw );
|
||||
return sw.toString();
|
||||
}
|
||||
/**
|
||||
* Format an exception using
|
||||
*/
|
||||
public static String formatThrowable(Throwable t) {
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
t.printStackTrace(pw);
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue