FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-code-example/!temp/src/TempDetectMethod.java at master · cherkavi/java-code-example · GitHub
cherkavi
/
java-code-example
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
0
Code
Issues
0
Pull requests
42
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java-code-example
/
!temp
/
src
/
TempDetectMethod.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
52 lines (38 loc) · 1.22 KB
Breadcrumbs
java-code-example
/
!temp
/
src
/
TempDetectMethod.java
Copy path
File metadata and controls
executable file
·
52 lines (38 loc) · 1.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
org
.
apache
.
log4j
.
BasicConfigurator
;
import
org
.
apache
.
log4j
.
FileAppender
;
import
org
.
apache
.
log4j
.
Level
;
import
org
.
apache
.
log4j
.
Logger
;
import
org
.
apache
.
log4j
.
PatternLayout
;
import
org
.
apache
.
log4j
.
SimpleLayout
;
public
class
TempDetectMethod
{
public
static
void
main
(
String
[]
args
){
BasicConfigurator
.
configure
();
Logger
.
getRootLogger
().
setLevel
(
Level
.
DEBUG
);
try
{
Logger
.
getRootLogger
().
addAppender
(
new
FileAppender
(
new
PatternLayout
(
"---%m%n"
),
"c:
\\
out.txt"
));
}
catch
(
Exception
ex
){
System
.
out
.
println
(
"Logger was not connected"
);
}
Example
example
=
new
Example
();
example
.
setString
(
"this is value"
);
System
.
out
.
println
(
example
.
getString
());
}
}
class
Example
{
private
Logger
logger
=
Logger
.
getLogger
(
this
.
getClass
());
private
void
debug
(
Object
information
){
StackTraceElement
element
=(
new
Throwable
()).
getStackTrace
()[
1
];
logger
.
debug
(
"Class: "
+
element
.
getClassName
()+
" Method:"
+
element
.
getMethodName
()+
" "
+
information
);
}
private
String
value
;
public
void
setString
(
String
value
){
debug
(
"set value"
);
this
.
value
=
value
;
}
public
String
getString
(){
debug
(
"get value"
);
return
this
.
value
;
}
public
Example
(){
}
}
Back
|
FazBrowse Home
|
New Git URL