Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
855de73c
Commit
855de73c
authored
Dec 27, 2012
by
Sylvain Berfini
🎩
Browse files
Moved Log java class from linphone core to mediastreamer
parent
eb27f4c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
113 deletions
+1
-113
java/impl/org/linphone/core/Log.java
java/impl/org/linphone/core/Log.java
+0
-112
mediastreamer2
mediastreamer2
+1
-1
No files found.
java/impl/org/linphone/core/Log.java
deleted
100644 → 0
View file @
eb27f4c3
/*
Log.java
Copyright (C) 2011 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
;
import
static
android
.
util
.
Log
.
DEBUG
;
import
static
android
.
util
.
Log
.
ERROR
;
import
static
android
.
util
.
Log
.
INFO
;
import
static
android
.
util
.
Log
.
WARN
;
/**
* Convenient wrapper for Android logs.
*
* @author Guillaume Beraudo
*/
public
final
class
Log
{
public
static
final
String
TAG
=
"Linphone"
;
private
static
final
boolean
useIsLoggable
=
false
;
@SuppressWarnings
(
value
=
"all"
)
private
static
boolean
isLoggable
(
int
level
)
{
return
!
useIsLoggable
||
android
.
util
.
Log
.
isLoggable
(
TAG
,
level
);
}
public
static
void
i
(
Object
...
objects
)
{
if
(
isLoggable
(
INFO
))
{
android
.
util
.
Log
.
i
(
TAG
,
toString
(
objects
));
}
}
public
static
void
i
(
Throwable
t
,
Object
...
objects
)
{
if
(
isLoggable
(
INFO
))
{
android
.
util
.
Log
.
i
(
TAG
,
toString
(
objects
),
t
);
}
}
public
static
void
d
(
Object
...
objects
)
{
if
(
isLoggable
(
DEBUG
))
{
android
.
util
.
Log
.
d
(
TAG
,
toString
(
objects
));
}
}
public
static
void
d
(
Throwable
t
,
Object
...
objects
)
{
if
(
isLoggable
(
DEBUG
))
{
android
.
util
.
Log
.
d
(
TAG
,
toString
(
objects
),
t
);
}
}
public
static
void
w
(
Object
...
objects
)
{
if
(
isLoggable
(
WARN
))
{
android
.
util
.
Log
.
w
(
TAG
,
toString
(
objects
));
}
}
public
static
void
w
(
Throwable
t
,
Object
...
objects
)
{
if
(
isLoggable
(
WARN
))
{
android
.
util
.
Log
.
w
(
TAG
,
toString
(
objects
),
t
);
}
}
public
static
void
e
(
Object
...
objects
)
{
if
(
isLoggable
(
ERROR
))
{
android
.
util
.
Log
.
e
(
TAG
,
toString
(
objects
));
}
}
public
static
void
e
(
Throwable
t
,
Object
...
objects
)
{
if
(
isLoggable
(
ERROR
))
{
android
.
util
.
Log
.
e
(
TAG
,
toString
(
objects
),
t
);
}
}
/**
* @throws RuntimeException always throw after logging the error message.
*/
public
static
void
f
(
Object
...
objects
)
{
if
(
isLoggable
(
ERROR
))
{
android
.
util
.
Log
.
e
(
TAG
,
toString
(
objects
));
throw
new
RuntimeException
(
"Fatal error : "
+
toString
(
objects
));
}
}
/**
* @throws RuntimeException always throw after logging the error message.
*/
public
static
void
f
(
Throwable
t
,
Object
...
objects
)
{
if
(
isLoggable
(
ERROR
))
{
android
.
util
.
Log
.
e
(
TAG
,
toString
(
objects
),
t
);
throw
new
RuntimeException
(
"Fatal error : "
+
toString
(
objects
),
t
);
}
}
private
static
String
toString
(
Object
...
objects
)
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
Object
o
:
objects
)
{
sb
.
append
(
o
);
}
return
sb
.
toString
();
}
}
mediastreamer2
@
ce4abb79
Subproject commit
49ffa1905460cb74725bbf5be20b4786de7fb5b6
Subproject commit
ce4abb79231bc1da097be70c93755ded9195701c
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment