Goal | Badges |
---|---|
Packages andReleases | |
JavaDocumentation | |
BuildStatus | |
JaCoCo TestCoverage | |
License |
Gangsutils stands for Gang Scala Utils, it includes several modules.
Replace ${gangsutils.version}
to the latest stable version showed in the nexus repository
badge
Note: Only import what you need to avoid unnecessary download.
Maven
<dependency>
<groupId>cn.tellyouwhat</groupId>
<artifactId>gangsutils-logger</artifactId>
<version>${gangsutils.version}</version>
</dependency>
<dependency>
<groupId>cn.tellyouwhat</groupId>
<artifactId>gangsutils-spark</artifactId>
<version>${gangsutils.version}</version>
</dependency>
<dependency>
<groupId>cn.tellyouwhat</groupId>
<artifactId>gangsutils-hadoop</artifactId>
<version>${gangsutils.version}</version>
</dependency>
<dependency>
<groupId>cn.tellyouwhat</groupId>
<artifactId>gangsutils-core</artifactId>
<version>${gangsutils.version}</version>
</dependency>
or import all by
<dependency>
<groupId>cn.tellyouwhat</groupId>
<artifactId>gangsutils-all</artifactId>
<version>${gangsutils.version}</version>
</dependency>
SBT
libraryDependencies += "cn.tellyouwhat" % "gangsutils-logger" % "${gangsutils.version}"
libraryDependencies += "cn.tellyouwhat" % "gangsutils-spark" % "${gangsutils.version}"
libraryDependencies += "cn.tellyouwhat" % "gangsutils-hadoop" % "${gangsutils.version}"
libraryDependencies += "cn.tellyouwhat" % "gangsutils-core" % "${gangsutils.version}"
or import all by
libraryDependencies += "cn.tellyouwhat" % "gangsutils-all" % "${gangsutils.version}"
Gradle
implementation 'cn.tellyouwhat:gangsutils-logger:${gangsutils.version}'
implementation 'cn.tellyouwhat:gangsutils-spark:${gangsutils.version}'
implementation 'cn.tellyouwhat:gangsutils-hadoop:${gangsutils.version}'
implementation 'cn.tellyouwhat:gangsutils-core:${gangsutils.version}'
or import all by
implementation 'cn.tellyouwhat:gangsutils-all:${gangsutils.version}'
If you just want functions and helpers which do not involve spark and hadoop, add only gangsutils-core
dependency.
There are a lot of strings, used to build log content and test.
These functions could be useful in you are coding in Scala, see https://github.com/HarborZeng/gangsutils/blob/master/gangsutils-core/src/test/scala/cn/tellyouwhat/gangsutils/core/funcsTest.scala test case for use case.
There are a few helpers, like ConfigReader
, I18N
(internal use only) and chaining
.
chaining
is a good implicit object that can help you write scala code with less val
s and var
s.
It implements tap
and pipe
like in unix terminal system.
You can refer to https://alvinalexander.com/scala/scala-2.13-pipe-tap-chaining-operations/ for example.
PS: Implementation in chaining
is |!
for tap
and |>
for pipe
eg,
If you just want functions and helpers which is spark related, add only gangsutils-spark
dependency.
Spark function.
see https://github.com/HarborZeng/gangsutils/blob/master/gangsutils-spark/src/test/scala/cn/tellyouwhat/gangsutils/spark/funcsTest.scala for use cases.
- Make I18N private in gangsutils
- Change
gangConfig.properties
file name togangsutilsConfig.properties
- Use yaml instead of properties file for configuration
- Use system default language and region when
gangsutilsConfig.properties
is overwritten butdefault-lang
ordefault-region
are missing - Change
sendRequest
parameterqueryStrings
toform
- Extract
.replaceAll("""\e\[[\d;]*[^\d;]""", "")
to a methodstripANSIColor
- Change
Logger
defaultLogDest
toPRINTLN_LOGGER
to test whetherenabled
parameter works when logger is got byGangLogger.getLogger
- Separate spark and hadoop tools into separate modules
- Extract logger module from common module
- Add FileLogger (by date)
- Add LogStash(Stream)Logger
- Make hostname lazy
- Make log a case class containing hostname, datetime, trace, content and etc, serialize it when using(println or send to webhook)
- Different log configurations for different logs by default value and config file
- Add proxy settings for TelegramWebhookLogger
-
.replace("\n", "\\n")
- async log
- static members setup for each logger individually
- stacktrace