From 2cb7be8f7d16f5174cd3651a73c6f5c7cfec98d2 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 18 May 2010 17:50:14 +0200 Subject: [PATCH] add external log handler --- .../linphone/core/LinphoneCoreFactory.java | 3 +- .../org/linphone/core/LinphoneLogHandler.java | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 java/common/org/linphone/core/LinphoneLogHandler.java diff --git a/java/common/org/linphone/core/LinphoneCoreFactory.java b/java/common/org/linphone/core/LinphoneCoreFactory.java index b267373a3..b3e2952fb 100644 --- a/java/common/org/linphone/core/LinphoneCoreFactory.java +++ b/java/common/org/linphone/core/LinphoneCoreFactory.java @@ -60,5 +60,6 @@ abstract public class LinphoneCoreFactory { * @param enable */ abstract public void setDebugMode(boolean enable); - + + abstract public void setLogHandler(LinphoneLogHandler handler); } diff --git a/java/common/org/linphone/core/LinphoneLogHandler.java b/java/common/org/linphone/core/LinphoneLogHandler.java new file mode 100644 index 000000000..d1330a400 --- /dev/null +++ b/java/common/org/linphone/core/LinphoneLogHandler.java @@ -0,0 +1,29 @@ +/* +LinphoneLogHandler.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + +public interface LinphoneLogHandler { + public static final int Fatal=1<<4; + public static final int Error=1<<3|Fatal; + public static final int Warn=1<<2|Error; + public static final int Info=1<<1|Warn; + public static final int Debug=1|Info; + + public void log(String loggerName, int level, String levelString, String msg, Throwable e); +}