-
Notifications
You must be signed in to change notification settings - Fork 4
/
LoggerTest.kt
executable file
·104 lines (97 loc) · 4.45 KB
/
LoggerTest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import org.hydev.logger.HyLogger
import org.hydev.logger.HyLoggerConfig
import org.hydev.logger.appenders.FileAppender
import org.hydev.logger.coloring.GradientPresets.BPR
import org.hydev.logger.coloring.GradientPresets.RAINBOW
import java.awt.Color
/**
* 此类由 Hykilpikonna 在 2018/05/04 创建!
* Created by Hykilpikonna on 2018/05/04!
* Github: https://github.com/hykilpikonna
* Meow!
*
* @author Hykilpikonna
*/
object LoggerTest
{
@JvmStatic
fun main(args: Array<String>)
{
val logger = HyLogger("General")
HyLoggerConfig.debug = true
HyLoggerConfig.appenders.add(FileAppender("./logs/", "test.log"))
logger.log("Oak logs are the best.")
logger.debug("This is not logged if HyLoggerConfig.debug is off.")
logger.error("This could never happen in theory, right?")
logger.warning("Nerf this!")
logger.log("")
logger.fancy.gradient("=========== Linear Gradient ===========", Color.BLUE, Color.CYAN)
logger.fancy.gradient("=========== Linear Gradient ===========", Color.ORANGE, Color.CYAN)
logger.fancy.gradient("=========== Linear Gradient ===========", Color(0, 242, 96), Color(80, 161, 230))
logger.fancy.gradient("=========== Linear Gradient ===========", Color(255, 140, 0), Color(255, 0, 128))
logger.log("")
logger.log("Gradient with more than 2 color positions:")
logger.fancy.gradient("""
|########################################
|########## Gradient ##########
|########################################""".trimMargin(), RAINBOW)
logger.log("")
logger.log("Angled gradient on ascii art:")
logger.fancy.gradient("""
┬ ┬┬ ┬┬ ┌─┐┌─┐┌─┐┌─┐┬─┐
├─┤└┬┘│ │ ││ ┬│ ┬├┤ ├┬┘
┴ ┴ ┴ ┴─┘└─┘└─┘└─┘└─┘┴└─""".trimIndent(), BPR, 15.0)
// logger.fancy.gradient("Initiating...", Color.ORANGE, Color.YELLOW)
// logger.timing.reset()
// println()
//
// logger.log("一条测试Log消息")
// logger.error("一条测试Error消息")
// logger.warning("一条测试Warning消息")
// logger.debug("一条没发出去的Debug消息")
// HyLoggerConfig.debug = true
// logger.debug("一条发出去了的Debug消息")
// logger.timing.time().reset()
//
// logger.fancy.gradient("测试渐变从深蓝到浅蓝", Color.BLUE, Color.CYAN)
// logger.timing.time().reset()
//
// logger.fancy.gradient("测试渐变从橘色到浅蓝", Color.ORANGE, Color.CYAN)
// logger.timing.time().reset()
//
// logger.fancy.gradient("测试黄绿渐变到天蓝", Color(0, 242, 96), Color(80, 161, 230))
// logger.timing.time().reset()
//
// logger.fancy.gradient("测试橙色渐变到粉色", Color(255, 140, 0), Color(255, 0, 128))
// logger.timing.time().reset()
//
// logger.fancy.gradient("""
// |############################################
// |########## 中文不会打断渐变色啦w ###########
// |############################################""".trimMargin(), RAINBOW)
// logger.timing.time().reset()
//
// logger.fancy.gradient("""
// |############################################
// |########### Blue to Purple to Red ##########
// |############################################""".trimMargin(), BPR)
// logger.timing.time().reset()
//
// logger.log("Testing angled gradient on text block #1:")
// logger.fancy.gradient("""
// ┬ ┬┬ ┬┬ ┌─┐┌─┐┌─┐┌─┐┬─┐
// ├─┤└┬┘│ │ ││ ┬│ ┬├┤ ├┬┘
// ┴ ┴ ┴ ┴─┘└─┘└─┘└─┘└─┘┴└─""".trimIndent(), BPR, 15.0)
// logger.timing.time().reset()
//
// logger.log("Testing angled gradient on text block #2:")
// logger.fancy.gradient("""
// __ __ __
// / / / /_ __/ / ____ ____ _____ ____ _____
// / /_/ / / / / / / __ \/ __ `/ __ `/ _ \/ ___/
// / __ / /_/ / /___/ /_/ / /_/ / /_/ / __/ /
// /_/ /_/\__, /_____/\____/\__, /\__, /\___/_/
// /____/ /____//____/ """.trimIndent(), BOP, 60.0)
// logger.timing.time().reset()
}
}