Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
e3d4d793
Commit
e3d4d793
authored
5 years ago
by
Mark OLESEN
Committed by
Andrew Heather
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add InfoErr stream. Same as Info, but with stderr instead of stdout
parent
5213a4aa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/error/messageStream.C
+30
-35
30 additions, 35 deletions
src/OpenFOAM/db/error/messageStream.C
src/OpenFOAM/db/error/messageStream.H
+7
-3
7 additions, 3 deletions
src/OpenFOAM/db/error/messageStream.H
with
37 additions
and
38 deletions
src/OpenFOAM/db/error/messageStream.C
+
30
−
35
View file @
e3d4d793
...
...
@@ -200,48 +200,41 @@ Foam::messageStream::operator Foam::OSstream&()
{
if
(
level
)
{
const
bool
collect
=
(
severity_
==
INFO
||
severity_
==
WARNING
);
const
bool
collect
=
(
severity_
==
INFO
||
severity_
==
INFO_STDERR
||
severity_
==
WARNING
);
// Report the error
// Could add guard with parRun
if
(
collect
&&
!
Pstream
::
master
())
{
return
Snull
;
}
else
OSstream
&
os
=
(
(
collect
||
!
Pstream
::
parRun
())
?
((
severity_
==
INFO_STDERR
)
?
Serr
:
Sout
)
:
Pout
);
if
(
!
title
().
empty
())
{
if
(
!
title
().
empty
())
{
if
(
collect
||
!
Pstream
::
parRun
())
{
Sout
<<
title
().
c_str
();
}
else
{
Pout
<<
title
().
c_str
();
}
}
if
(
maxErrors_
)
{
++
errorCount_
;
if
(
errorCount_
>=
maxErrors_
)
{
FatalErrorInFunction
<<
"Too many errors"
<<
abort
(
FatalError
);
}
}
if
(
collect
||
!
Pstream
::
parRun
())
{
return
Sout
;
}
else
{
return
Pout
;
}
os
<<
title
().
c_str
();
}
if
(
maxErrors_
&&
(
++
errorCount_
>=
maxErrors_
))
{
FatalErrorInFunction
<<
"Too many errors"
<<
abort
(
FatalError
);
}
return
os
;
}
return
Snull
;
...
...
@@ -252,6 +245,8 @@ Foam::messageStream::operator Foam::OSstream&()
Foam
::
messageStream
Foam
::
Info
(
""
,
messageStream
::
INFO
);
Foam
::
messageStream
Foam
::
InfoErr
(
""
,
messageStream
::
INFO_STDERR
);
Foam
::
messageStream
Foam
::
Warning
(
"--> FOAM Warning : "
,
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/error/messageStream.H
+
7
−
3
View file @
e3d4d793
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-201
8
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
...
...
@@ -76,10 +76,11 @@ public:
//- Message type, or error severity flags
enum
errorSeverity
{
INFO
,
//!< General information output
, not necessarily an error.
INFO
=
1
,
//!< General information output
WARNING
,
//!< Warning of possible problem.
SERIOUS
,
//!< A serious problem - eg, data corruption.
FATAL
//!< A fatal error.
FATAL
,
//!< A fatal error.
INFO_STDERR
=
INFO
|
0x10
,
//!< Information, but on stderr
};
...
...
@@ -228,6 +229,9 @@ extern int infoDetailLevel;
//- Information stream (uses stdout - output is on the master only)
extern
messageStream
Info
;
//- Information stream (uses stderr - output is on the master only)
extern
messageStream
InfoErr
;
//- Warning stream (uses stdout - output is on the master only),
//- with additional 'FOAM Warning' header text.
extern
messageStream
Warning
;
...
...
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