This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name LinkedIn hide jobs | |
// @namespace linkedin | |
// @version 0.2 | |
// @description try to take over the world! | |
// @author me | |
// @match https://www.linkedin.com/jobs/search/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-3.4.1.min.js | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BankServiceLogTest { | |
private val bankService: BankService = BankService() | |
@Test | |
fun `should not contain card number`() { | |
// GIVEN | |
val cardNumber = "4012888888881882" | |
bankService.doTransaction(cardNumber) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Plugin( | |
name = "TestLogAppender", | |
category = "Core", | |
elementType = "appender", | |
printObject = true | |
) | |
class TestLogAppender( | |
name: String?, | |
filter: Filter?, | |
private val patternLayout: Layout<String>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Plugin(name = "MaskingPatternLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = false) | |
class MaskingPatternLayout( | |
charset: Charset?, | |
private val patternLayout: PatternLayout | |
) : AbstractStringLayout(charset) { | |
companion object { | |
private const val CARD_MASK = "$1++++++++++++" | |
private val CARD_PATTERN = Pattern.compile("([0-9]{4})([0-9]{9,15})") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="info" name="TestApp" packages='com.antosha4e.log'> | |
<Appenders> | |
<Console name="INLINE_PATTERN" target="SYSTEM_OUT"> | |
<MaskingPatternLayout pattern="%d %highlight{%p} %c{1.} [%t] %m%n" /> | |
</Console> | |
<Console name="NESTED_PATTERN" target="SYSTEM_OUT"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="info" name="TestApp" packages='com.antosha4e.log'> | |
<Appenders> | |
<Console name="NAIVE_MASK" target="SYSTEM_OUT"> | |
<PatternLayout> | |
<pattern>%d %highlight{%p} %c{1.} [%t] %m%n</pattern> | |
<replace regex="([0-9]{4})([0-9]{9,15})" replacement="$1************"/> | |
</PatternLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
class BankService { | |
private val log: Logger = LoggerFactory.getLogger(BankService::class.java) | |
fun doTransaction(cardNumber: String) { | |
log.info("Started transaction") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CoffeeServiceTest { | |
private CoffeeService coffeeService = new CoffeeService(); | |
@Test | |
public void testLogOutputNaive() { | |
final String baristaName = "Stavros Domatiotis"; | |
final String coffeeName = "Flat White"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// note: class name need not match the @Plugin name. | |
@Plugin(name = "TestLogAppender", category = "Core", elementType = "appender", printObject = true) | |
public class TestLogAppender extends AbstractAppender { | |
private static TestLogAppender instance; | |
public static TestLogAppender getInstance() { | |
return instance; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="info" name="TestApp"> | |
<Appenders> | |
<Console name="STDOUT" target="SYSTEM_OUT"> | |
<PatternLayout pattern='%d %highlight{%p} %c{1.} [%t] %m%n'/> | |
</Console> | |
<Async name="Async"> | |
<AppenderRef ref="STDOUT"/> | |
</Async> |
NewerOlder