Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
d07a3e68
Commit
d07a3e68
authored
12 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[logging] remove created()
it's much better to inform the user about missing Logger initialization
parent
5a3def75
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
dune/stuff/common/logging.cc
+3
-10
3 additions, 10 deletions
dune/stuff/common/logging.cc
dune/stuff/common/logging.hh
+0
-2
0 additions, 2 deletions
dune/stuff/common/logging.hh
with
3 additions
and
12 deletions
dune/stuff/common/logging.cc
+
3
−
10
View file @
d07a3e68
...
@@ -76,15 +76,8 @@ void Logging::create(int logflags, const std::string logfile, const std::string
...
@@ -76,15 +76,8 @@ void Logging::create(int logflags, const std::string logfile, const std::string
flagmap_
[
*
it
]
=
logflags
;
flagmap_
[
*
it
]
=
logflags
;
streammap_
[
*
it
]
=
new
FileLogStream
(
*
it
,
flagmap_
[
*
it
],
logfile_
);
streammap_
[
*
it
]
=
new
FileLogStream
(
*
it
,
flagmap_
[
*
it
],
logfile_
);
}
}
created_
=
true
;
}
// Create
}
// Create
bool
Logging
::
created
()
const
{
return
created_
;
}
void
Logging
::
setPrefix
(
std
::
string
prefix
)
void
Logging
::
setPrefix
(
std
::
string
prefix
)
{
{
deinit
();
deinit
();
...
@@ -103,7 +96,8 @@ int Logging::getStreamFlags(int streamID) const
...
@@ -103,7 +96,8 @@ int Logging::getStreamFlags(int streamID) const
{
{
const
auto
it
=
flagmap_
.
find
(
streamID
);
const
auto
it
=
flagmap_
.
find
(
streamID
);
if
(
it
==
flagmap_
.
end
())
if
(
it
==
flagmap_
.
end
())
DUNE_THROW
(
InvalidStateException
,
"cannot get flags for unkown Stream id"
);
DUNE_THROW
(
InvalidStateException
,
"cannot get flags for unkown Stream id, maybe you forgot to call
\"
Logging::create
\"
?"
);
return
it
->
second
;
return
it
->
second
;
}
}
...
@@ -111,8 +105,7 @@ LogStream& Logging::getStream(int streamId)
...
@@ -111,8 +105,7 @@ LogStream& Logging::getStream(int streamId)
{
{
const
auto
it
=
streammap_
.
find
(
streamId
);
const
auto
it
=
streammap_
.
find
(
streamId
);
if
(
it
==
streammap_
.
end
())
if
(
it
==
streammap_
.
end
())
return
emptyLogStream_
;
DUNE_THROW
(
InvalidStateException
,
"cannot get unknown logStream, maybe you forgot to call
\"
Logging::create
\"
?"
);
// DUNE_THROW(InvalidStateException, "cannot get unkown Stream");
else
{
else
{
assert
(
it
->
second
);
assert
(
it
->
second
);
return
*
(
it
->
second
);
return
*
(
it
->
second
);
...
...
This diff is collapsed.
Click to expand it.
dune/stuff/common/logging.hh
+
0
−
2
View file @
d07a3e68
...
@@ -45,8 +45,6 @@ private:
...
@@ -45,8 +45,6 @@ private:
public:
public:
~
Logging
();
~
Logging
();
bool
created
()
const
;
/** \brief setup loglevel, logfilename
/** \brief setup loglevel, logfilename
* \param logflags any OR'd combination of flags
* \param logflags any OR'd combination of flags
* \param logfile filename for log, can contain paths, but creation will fail if dir is non-existant
* \param logfile filename for log, can contain paths, but creation will fail if dir is non-existant
...
...
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