Java Code Examples for no.nordicsemi.android.log.Logger#log()

The following examples show how to use no.nordicsemi.android.log.Logger#log() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: nRFLoggerTree.java    From nRF-Logger-API with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
protected void log(@LogPriority final int priority, @Nullable final String tag,
				   @NonNull final String message, @Nullable final Throwable t) {
	if (session == null)
		return;

	final int level = LogContract.Log.Level.fromPriority(priority);

	// Ignore t. Stack trace is already added to the message by prepareLog

	if (tag == null) {
		Logger.log(session, level, message);
	} else {
		Logger.log(session, level, "[" + tag + "] " + message);
	}
}
 
Example 2
Source File: LoggableBleManager.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void log(final int priority, @NonNull final String message) {
	Logger.log(mLogSession, LogContract.Log.Level.fromPriority(priority), message);
	Log.println(priority, "BleManager", message);
}
 
Example 3
Source File: BlinkyManager.java    From Android-nRF-Blinky with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void log(final int priority, @NonNull final String message) {
	// The priority is a Log.X constant, while the Logger accepts it's log levels.
	Logger.log(logSession, LogContract.Log.Level.fromPriority(priority), message);
}
 
Example 4
Source File: LoggableBleManager.java    From Android-nRF-Toolbox with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void log(final int priority, @NonNull final String message) {
	Logger.log(logSession, LogContract.Log.Level.fromPriority(priority), message);
	Log.println(priority, "BleManager", message);
}
 
Example 5
Source File: BleProfileService.java    From Android-nRF-Toolbox with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void log(final int level, @NonNull final String message) {
    Logger.log(logSession, level, message);
}
 
Example 6
Source File: BleProfileService.java    From Android-nRF-Toolbox with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void log(final int level, final @StringRes int messageRes, final Object... params) {
    Logger.log(logSession, level, messageRes, params);
}
 
Example 7
Source File: MainFragment.java    From nRF-Logger-API with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Appends a new log line.
 * 
 * @param text
 *            the log content
 * @param level
 *            the entry level
 */
private void append(@NonNull final String text, final int level) {
	Logger.log(mLogSession, level, text);
}