Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Input szoftver projekt laboratorium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aaendru
Input szoftver projekt laboratorium
Commits
f5d61dc2
Commit
f5d61dc2
authored
5 years ago
by
CsellarAndras
Browse files
Options
Downloads
Patches
Plain Diff
Removed color
parent
f69a239e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Arctic_Nigthmare/src/arctic_nightmare/Logger.java
+8
-59
8 additions, 59 deletions
Arctic_Nigthmare/src/arctic_nightmare/Logger.java
with
8 additions
and
59 deletions
Arctic_Nigthmare/src/arctic_nightmare/Logger.java
+
8
−
59
View file @
f5d61dc2
...
@@ -5,18 +5,7 @@ import java.io.InputStreamReader;
...
@@ -5,18 +5,7 @@ import java.io.InputStreamReader;
import
java.util.Scanner
;
import
java.util.Scanner
;
final
public
class
Logger
{
final
public
class
Logger
{
private
static
final
String
RESET
=
""
;
private
static
final
String
BLACK
=
"\u001B[30m"
;
private
static
final
String
RED
=
"\u001B[31m"
;
private
static
final
String
GREEN
=
"\u001B[32m"
;
private
static
final
String
YELLOW
=
"\u001B[33m"
;
private
static
final
String
BLUE
=
"\u001B[34m"
;
private
static
final
String
PURPLE
=
"\u001B[35m"
;
private
static
final
String
CYAN
=
"\u001B[36m"
;
private
static
final
String
WHITE
=
"\u001B[37m"
;
private
static
int
tabs
;
private
static
int
tabs
;
public
enum
colors
{
RESET
,
BLACK
,
RED
,
GREEN
,
YELLOW
,
BLUE
,
PURPLE
,
CYAN
,
WHITE
};
private
static
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
));
private
static
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
));
private
static
Scanner
scanner
=
new
Scanner
(
System
.
in
);
private
static
Scanner
scanner
=
new
Scanner
(
System
.
in
);
...
@@ -25,31 +14,7 @@ final public class Logger {
...
@@ -25,31 +14,7 @@ final public class Logger {
tabs
=
0
;
tabs
=
0
;
}
}
private
static
String
getColorCode
(
colors
color
)
{
switch
(
color
)
{
case
RESET:
return
RESET
;
case
BLACK:
return
BLACK
;
case
RED:
return
RED
;
case
GREEN:
return
GREEN
;
case
CYAN:
return
CYAN
;
case
YELLOW:
return
YELLOW
;
case
BLUE:
return
BLUE
;
case
PURPLE:
return
PURPLE
;
case
WHITE:
return
WHITE
;
}
return
RESET
;
}
static
int
getNumericInput
(
int
lowerConstraint
,
int
upperConstraint
)
{
static
int
getNumericInput
(
int
lowerConstraint
,
int
upperConstraint
)
{
int
c
=
scanner
.
nextInt
();
int
c
=
scanner
.
nextInt
();
while
(
c
<
lowerConstraint
||
c
>
upperConstraint
)
{
while
(
c
<
lowerConstraint
||
c
>
upperConstraint
)
{
...
@@ -75,42 +40,26 @@ final public class Logger {
...
@@ -75,42 +40,26 @@ final public class Logger {
if
(
1
>
tabs
)
tabs
=
0
;
if
(
1
>
tabs
)
tabs
=
0
;
}
}
static
void
Log
(
String
message
,
colors
color
)
{
if
(
tabs
!=
0
)
System
.
out
.
println
(
getColorCode
(
color
)
+
String
.
format
(
"%0"
+
tabs
+
"d"
,
0
).
replace
(
"0"
,
"\t"
)
+
message
+
RESET
);
else
System
.
out
.
println
(
getColorCode
(
color
)
+
message
+
RESET
);
}
static
void
Log
(
String
message
)
static
void
Log
(
String
message
)
{
{
Log
(
message
,
colors
.
RESET
);
if
(
tabs
!=
0
)
System
.
out
.
println
(
String
.
format
(
"%0"
+
tabs
+
"d"
,
0
).
replace
(
"0"
,
"\t"
)
+
message
);
else
System
.
out
.
println
(
message
);
}
}
static
void
Log
(
String
message
,
boolean
tabulated
)
{
static
void
Log
(
String
message
,
boolean
tabulated
)
{
if
(!
tabulated
)
System
.
out
.
println
(
message
);
if
(!
tabulated
)
System
.
out
.
println
(
message
);
else
Log
(
message
,
colors
.
RESET
);
else
Log
(
message
);
}
static
void
LogAndIncreaseTabs
(
String
message
,
colors
color
)
{
Log
(
message
,
color
);
increaseTabs
();
}
}
static
void
LogAndIncreaseTabs
(
String
message
)
static
void
LogAndIncreaseTabs
(
String
message
)
{
{
LogAndIncreaseTabs
(
message
,
colors
.
RESET
);
Log
(
message
);
}
increaseTabs
();
static
void
LogAndDecreaseTabs
(
String
message
,
colors
color
)
{
Log
(
message
,
color
);
decreaseTabs
();
}
}
static
void
LogAndDecreaseTabs
(
String
message
)
static
void
LogAndDecreaseTabs
(
String
message
)
{
{
LogAndDecreaseTabs
(
message
,
colors
.
RESET
);
Log
(
message
);
decreaseTabs
();
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment