Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
d32e678f
Commit
d32e678f
authored
Jan 27, 2026
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continue previous commit
parent
1e93c781
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
95 deletions
+33
-95
LogTee.java
src/main/java/com/elphel/imagej/common/LogTee.java
+6
-93
EyesisTiff.java
src/main/java/com/elphel/imagej/readers/EyesisTiff.java
+27
-2
No files found.
src/main/java/com/elphel/imagej/common/LogTee.java
View file @
d32e678f
...
@@ -4,7 +4,6 @@ import java.io.FileOutputStream;
...
@@ -4,7 +4,6 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.io.PrintStream
;
import
java.io.PrintStream
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
/**
/**
...
@@ -21,9 +20,6 @@ public final class LogTee {
...
@@ -21,9 +20,6 @@ public final class LogTee {
private
static
volatile
PrintStream
fileStream
=
null
;
private
static
volatile
PrintStream
fileStream
=
null
;
private
static
volatile
Path
sceneLogPath
=
null
;
private
static
volatile
Path
sceneLogPath
=
null
;
private
static
volatile
boolean
installed
=
false
;
private
static
volatile
boolean
installed
=
false
;
// codex 2026-01-25: optional console/file noise filter
private
static
volatile
boolean
filterEnabled
=
false
;
private
static
volatile
String
[]
filterSubstrings
=
null
;
private
LogTee
()
{
private
LogTee
()
{
}
}
...
@@ -31,7 +27,6 @@ public final class LogTee {
...
@@ -31,7 +27,6 @@ public final class LogTee {
public
static
void
install
()
{
public
static
void
install
()
{
synchronized
(
LOCK
)
{
synchronized
(
LOCK
)
{
if
(
installed
)
return
;
if
(
installed
)
return
;
configureFilterFromProperty
();
System
.
setOut
(
new
PrintStream
(
new
TeeStream
(
ORIGINAL_OUT
),
true
));
System
.
setOut
(
new
PrintStream
(
new
TeeStream
(
ORIGINAL_OUT
),
true
));
System
.
setErr
(
new
PrintStream
(
new
TeeStream
(
ORIGINAL_ERR
),
true
));
System
.
setErr
(
new
PrintStream
(
new
TeeStream
(
ORIGINAL_ERR
),
true
));
installed
=
true
;
installed
=
true
;
...
@@ -62,55 +57,6 @@ public final class LogTee {
...
@@ -62,55 +57,6 @@ public final class LogTee {
return
sceneLogPath
;
return
sceneLogPath
;
}
}
// codex 2026-01-25: set filters via -Delphel.logtee.filter
// Values:
// "ome" -> built-in OME/Bio-Formats noise filters
// "none" -> disable filtering
// comma-separated substrings to drop lines containing any of them
private
static
void
configureFilterFromProperty
()
{
String
value
=
System
.
getProperty
(
"elphel.logtee.filter"
);
if
(
value
==
null
||
value
.
trim
().
isEmpty
())
{
filterEnabled
=
false
;
filterSubstrings
=
null
;
return
;
}
String
trimmed
=
value
.
trim
();
if
(
"none"
.
equalsIgnoreCase
(
trimmed
))
{
filterEnabled
=
false
;
filterSubstrings
=
null
;
return
;
}
if
(
"ome"
.
equalsIgnoreCase
(
trimmed
))
{
filterEnabled
=
true
;
filterSubstrings
=
new
String
[]
{
"Loaded properties from: services.properties"
,
"Added interface interface ome.codecs.services.JAIIIOService"
,
"Checking comment style"
,
"Expected positive value for PhysicalSize"
,
"Parsing TIFF EXIF data"
,
"Populating OME metadata"
,
"Reading IFDs"
};
return
;
}
String
[]
parts
=
trimmed
.
split
(
","
);
filterEnabled
=
parts
.
length
>
0
;
filterSubstrings
=
parts
;
}
private
static
boolean
shouldFilterLine
(
String
line
)
{
if
(!
filterEnabled
||
filterSubstrings
==
null
||
line
==
null
)
{
return
false
;
}
for
(
String
token
:
filterSubstrings
)
{
if
(
token
==
null
)
continue
;
String
t
=
token
.
trim
();
if
(
t
.
isEmpty
())
continue
;
if
(
line
.
contains
(
t
))
return
true
;
}
return
false
;
}
private
static
void
closeFileStream
()
{
private
static
void
closeFileStream
()
{
if
(
fileStream
!=
null
)
{
if
(
fileStream
!=
null
)
{
fileStream
.
flush
();
fileStream
.
flush
();
...
@@ -120,7 +66,6 @@ public final class LogTee {
...
@@ -120,7 +66,6 @@ public final class LogTee {
private
static
final
class
TeeStream
extends
OutputStream
{
private
static
final
class
TeeStream
extends
OutputStream
{
private
final
PrintStream
console
;
private
final
PrintStream
console
;
private
final
StringBuilder
buffer
=
new
StringBuilder
();
private
TeeStream
(
PrintStream
console
)
{
private
TeeStream
(
PrintStream
console
)
{
this
.
console
=
console
;
this
.
console
=
console
;
...
@@ -128,55 +73,23 @@ public final class LogTee {
...
@@ -128,55 +73,23 @@ public final class LogTee {
@Override
@Override
public
void
write
(
int
b
)
throws
IOException
{
public
void
write
(
int
b
)
throws
IOException
{
if
(!
filterEnabled
)
{
console
.
write
(
b
);
console
.
write
(
b
);
PrintStream
fs
=
fileStream
;
PrintStream
fs
=
fileStream
;
if
(
fs
!=
null
)
fs
.
write
(
b
);
if
(
fs
!=
null
)
fs
.
write
(
b
);
return
;
}
buffer
.
append
((
char
)
b
);
if
(
b
==
'\n'
)
{
flushBuffer
();
}
}
}
@Override
@Override
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
if
(!
filterEnabled
)
{
console
.
write
(
b
,
off
,
len
);
console
.
write
(
b
,
off
,
len
);
PrintStream
fs
=
fileStream
;
PrintStream
fs
=
fileStream
;
if
(
fs
!=
null
)
fs
.
write
(
b
,
off
,
len
);
if
(
fs
!=
null
)
fs
.
write
(
b
,
off
,
len
);
return
;
}
String
chunk
=
new
String
(
b
,
off
,
len
,
StandardCharsets
.
UTF_8
);
for
(
int
i
=
0
;
i
<
chunk
.
length
();
i
++)
{
char
c
=
chunk
.
charAt
(
i
);
buffer
.
append
(
c
);
if
(
c
==
'\n'
)
{
flushBuffer
();
}
}
}
}
@Override
@Override
public
void
flush
()
throws
IOException
{
public
void
flush
()
throws
IOException
{
if
(
filterEnabled
&&
buffer
.
length
()
>
0
)
{
flushBuffer
();
}
console
.
flush
();
console
.
flush
();
PrintStream
fs
=
fileStream
;
PrintStream
fs
=
fileStream
;
if
(
fs
!=
null
)
fs
.
flush
();
if
(
fs
!=
null
)
fs
.
flush
();
}
}
private
void
flushBuffer
()
{
String
line
=
buffer
.
toString
();
buffer
.
setLength
(
0
);
if
(
shouldFilterLine
(
line
))
{
return
;
}
console
.
print
(
line
);
PrintStream
fs
=
fileStream
;
if
(
fs
!=
null
)
fs
.
print
(
line
);
}
}
}
}
}
src/main/java/com/elphel/imagej/readers/EyesisTiff.java
View file @
d32e678f
...
@@ -90,7 +90,6 @@ public class EyesisTiff {
...
@@ -90,7 +90,6 @@ public class EyesisTiff {
private
static
ClassList
<
IFormatReader
>
defaultClasses
;
private
static
ClassList
<
IFormatReader
>
defaultClasses
;
private
static
final
Logger
LOGGER
=
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ClassList
.
class
);
LoggerFactory
.
getLogger
(
ClassList
.
class
);
// codex 2026-01-25: reuse ServiceFactory/OMEXMLService to avoid repeated service init
private
static
ServiceFactory
SERVICE_FACTORY
=
null
;
private
static
ServiceFactory
SERVICE_FACTORY
=
null
;
private
static
OMEXMLService
OME_XML_SERVICE
=
null
;
private
static
OMEXMLService
OME_XML_SERVICE
=
null
;
public
static
ClassList
<
IFormatReader
>
getCustomReaderClasses
()
{
public
static
ClassList
<
IFormatReader
>
getCustomReaderClasses
()
{
...
@@ -132,7 +131,9 @@ public class EyesisTiff {
...
@@ -132,7 +131,9 @@ public class EyesisTiff {
String
inId
=
null
;
String
inId
=
null
;
inId
=
path
;
inId
=
path
;
OMEXMLService
service
=
getOmexmlService
();
OMEXMLService
service
=
useOmexmlSingleton
()
?
getOmexmlService
()
:
createOmexmlService
();
IMetadata
omeMeta
=
null
;
IMetadata
omeMeta
=
null
;
if
(
service
!=
null
)
{
if
(
service
!=
null
)
{
...
@@ -256,6 +257,30 @@ public class EyesisTiff {
...
@@ -256,6 +257,30 @@ public class EyesisTiff {
return
OME_XML_SERVICE
;
return
OME_XML_SERVICE
;
}
}
private
static
OMEXMLService
createOmexmlService
()
{
ServiceFactory
factory
=
null
;
try
{
factory
=
new
ServiceFactory
();
}
catch
(
DependencyException
e
)
{
e
.
printStackTrace
();
return
null
;
}
try
{
return
factory
.
getInstance
(
OMEXMLService
.
class
);
}
catch
(
DependencyException
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
private
static
boolean
useOmexmlSingleton
()
{
String
value
=
System
.
getProperty
(
"elphel.ome.singleton"
);
if
(
value
==
null
||
value
.
isEmpty
())
{
return
false
;
}
return
Boolean
.
parseBoolean
(
value
);
}
/*
/*
* image width getSizeX()
* image width getSizeX()
image height getSizeY()
image height getSizeY()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment