Skip to content

Commit

Permalink
Merge pull request #26 from muflihun/develop
Browse files Browse the repository at this point in the history
2.0.1
  • Loading branch information
abumq authored Mar 27, 2018
2 parents 8004adc + 10ad568 commit c6fcf81
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [2.0.1] - 27-03-2018
- Dispatch verbose logs always without check

## [2.0.0] - 01-03-2018
- Compatibility for server 2.0.0

Expand Down
29 changes: 29 additions & 0 deletions samples/jni/src/com/muflihun/residue/Logger.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
/**
* Logger.java
*
* Official Java client library for Residue logging server
*
* Copyright (C) 2017-present Muflihun Labs
*
* https://muflihun.com
* https://muflihun.github.io/residue
* https://github.com/muflihun/residue-java
*
* Author: @abumusamq
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.muflihun.residue;

import java.lang.Exception;

/**
* Contains implementations of the dispatch functions that sends log messages
*/
public class Logger {
private String id;

Expand Down
26 changes: 26 additions & 0 deletions samples/jni/src/com/muflihun/residue/Residue.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
/**
* Residue.java
*
* Official Java client library for Residue logging server
*
* Copyright (C) 2017-present Muflihun Labs
*
* https://muflihun.com
* https://muflihun.github.io/residue
* https://github.com/muflihun/residue-java
*
* Author: @abumusamq
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.muflihun.residue;

import cz.adamh.NativeUtils;
Expand Down
29 changes: 29 additions & 0 deletions samples/jni/src/com/muflihun/residue/ResiduePrintStream.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
/**
* ResiduePrintStream.java
*
* Official Java client library for Residue logging server
*
* Copyright (C) 2017-present Muflihun Labs
*
* https://muflihun.com
* https://muflihun.github.io/residue
* https://github.com/muflihun/residue-java
*
* Author: @abumusamq
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.muflihun.residue;

import java.io.PrintStream;

/**
* Print stream that sends to the residue server
*/
public class ResiduePrintStream extends PrintStream {

public ResiduePrintStream(PrintStream org) {
Expand Down
12 changes: 11 additions & 1 deletion samples/jni/src/residue-jni.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#include <jni.h>
//
// Part of residue native binding for java
//
// Copyright (C) 2017-present Muflihun Labs
//
// https://muflihun.com
// https://muflihun.github.io/residue
// https://github.com/muflihun/residue-java
//
// Author: @abumusamq

#include "residue-jni.h"
#include <residue/residue.h>

Expand Down
12 changes: 12 additions & 0 deletions samples/jni/src/residue-jni.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
//
// Part of residue native binding for java
//
// Copyright (C) 2017-present Muflihun Labs
//
// https://muflihun.com
// https://muflihun.github.io/residue
// https://github.com/muflihun/residue-java
//
// Author: @abumusamq
//

#include <jni.h>
#ifndef Residue_JNI_H
#define Residue_JNI_H
Expand Down
16 changes: 5 additions & 11 deletions src/com/muflihun/residue/Residue.java
Original file line number Diff line number Diff line change
Expand Up @@ -598,25 +598,19 @@ public void fatal(String message, Throwable throwable) {
}

public void verbose(Integer vlevel, String format, Object... args) {
if (isErrorEnabled()) {
String message = String.format(format, args);
String message = String.format(format, args);

log(message, LoggingLevels.VERBOSE, vlevel);
}
log(message, LoggingLevels.VERBOSE, vlevel);
}

public void verbose(Integer vlevel, Throwable t, String format, Object... args) {
if (isErrorEnabled()) {
String message = String.format(format, args);
String message = String.format(format, args);

verbose(vlevel, message, t);
}
verbose(vlevel, message, t);
}

public void verbose(Integer vlevel, String message, Throwable throwable) {
if (isErrorEnabled()) {
log(message, throwable, LoggingLevels.VERBOSE, vlevel);
}
log(message, throwable, LoggingLevels.VERBOSE, vlevel);
}

public void log(Object msg, Throwable t, LoggingLevels level) {
Expand Down

0 comments on commit c6fcf81

Please sign in to comment.