Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
/ stringmask Public archive

A micro-library for macro-based case class field masking in .toString

License

Notifications You must be signed in to change notification settings

softwaremill/stringmask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stringmask

Maven Central License Build Status

A micro-library for macro-based case class field masking in .toString(). Inspired by blog by Juan Pedro Moreno @47deg: http://www.47deg.com/blog/scala-macros-annotate-your-case-classes

Using stringmask

Builds are available for Scala 2.11 and 2.12

libraryDependencies ++= Seq(
  "com.softwaremill.stringmask" %% "stringmask" % "1.3.0",
  compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
)

Example usage:

import com.softwaremill.macros.customize.{customize, mask}
import java.util.Date

@customize
case class User(id: Long, @mask email: String, @mask dob: Date)
val user = User(1, "[email protected]", new Date(1458732695220L))

user.toString

should return User(1,***,***)