Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
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
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
dCache
cta
Commits
f18227f4
Commit
f18227f4
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Added cta::log::Logger::setLogMask()
parent
5cd91c64
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/log/Logger.cpp
+20
-1
20 additions, 1 deletion
common/log/Logger.cpp
common/log/Logger.hpp
+16
-1
16 additions, 1 deletion
common/log/Logger.hpp
with
36 additions
and
2 deletions
common/log/Logger.cpp
+
20
−
1
View file @
f18227f4
...
...
@@ -17,6 +17,7 @@
*/
#include
"common/log/Logger.hpp"
#include
"common/log/LogLevel.hpp"
#include
"common/utils/utils.hpp"
#include
"common/exception/Exception.hpp"
#include
<sys/time.h>
...
...
@@ -307,5 +308,23 @@ std::map<std::string, int>
return
m
;
}
//------------------------------------------------------------------------------
// setLogMask
//------------------------------------------------------------------------------
void
Logger
::
setLogMask
(
const
std
::
string
logMask
)
{
try
{
setLogMask
(
toLogLevel
(
logMask
));
}
catch
(
exception
::
Exception
&
ex
)
{
throw
exception
::
Exception
(
std
::
string
(
"Failed to set log mask: "
)
+
ex
.
getMessage
().
str
());
}
}
//------------------------------------------------------------------------------
// setLogMask
//------------------------------------------------------------------------------
void
Logger
::
setLogMask
(
const
int
logMask
)
{
m_logMask
=
logMask
;
}
}
// namespace log
}
// namespace cta
\ No newline at end of file
}
// namespace cta
This diff is collapsed.
Click to expand it.
common/log/Logger.hpp
+
16
−
1
View file @
f18227f4
...
...
@@ -21,6 +21,7 @@
#include
"common/log/Constants.hpp"
#include
"common/log/Param.hpp"
#include
<atomic>
#include
<list>
#include
<map>
...
...
@@ -123,6 +124,20 @@ public:
const
int
priority
,
const
std
::
string
&
msg
,
const
std
::
list
<
Param
>
&
params
=
std
::
list
<
Param
>
());
/**
* Sets the log mask.
*
* @param logMask The log mask.
*/
void
setLogMask
(
const
std
::
string
logMask
);
/**
* Sets the log mask.
*
* @param logMask The log mask.
*/
void
setLogMask
(
const
int
logMask
);
/**
* Writes the header of a syslog message to teh specifed output stream.
...
...
@@ -171,7 +186,7 @@ protected:
/**
* The log mask.
*/
int
m_logMask
;
std
::
atomic
<
int
>
m_logMask
;
/**
* The maximum message length that the client syslog server can handle.
...
...
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