1
0
Fork 0
arangodb/Logger/LoggerData.cpp

215 lines
7.3 KiB
C++

////////////////////////////////////////////////////////////////////////////////
/// @brief logger info
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2004-2012 triagens GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
/// @author Achim Brandt
/// @author Copyright 2007-2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
#include "LoggerInfo.h"
using namespace triagens::basics;
using namespace triagens::basics::LoggerData;
using namespace std;
// -----------------------------------------------------------------------------
// --SECTION-- static public variables
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Logging
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief the application name
////////////////////////////////////////////////////////////////////////////////
ApplicationName Info::_applicationName;
////////////////////////////////////////////////////////////////////////////////
/// @brief the facility name
////////////////////////////////////////////////////////////////////////////////
Facility Info::_facility;
////////////////////////////////////////////////////////////////////////////////
/// @brief the hostname
////////////////////////////////////////////////////////////////////////////////
HostName Info::_hostName;
////////////////////////////////////////////////////////////////////////////////
/// @brief the extra attribute
////////////////////////////////////////////////////////////////////////////////
size_t const Extra::npos = (size_t) -1;
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Logging
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief the application name
////////////////////////////////////////////////////////////////////////////////
ApplicationName::ApplicationName ()
: _name() {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the facility name
////////////////////////////////////////////////////////////////////////////////
Facility::Facility ()
: _name() {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the hostname
////////////////////////////////////////////////////////////////////////////////
HostName::HostName ()
: _name() {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the message identifier, automatically generated
////////////////////////////////////////////////////////////////////////////////
MessageIdentifier::MessageIdentifier ()
: _name() {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the proc and thread identifiers, automatically generated
////////////////////////////////////////////////////////////////////////////////
ProcessIdentifier::ProcessIdentifier ()
: _process(Thread::currentProcessId()),
_threadProcess(Thread::currentThreadProcessId()),
_thread(Thread::currentThreadId()) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the fucntional name
////////////////////////////////////////////////////////////////////////////////
Functional::Functional (string const& name)
: _name(name) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the peg name
////////////////////////////////////////////////////////////////////////////////
Peg::Peg (string const& name)
: _name(name) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the task name
////////////////////////////////////////////////////////////////////////////////
Task::Task (string const& name)
: _name(name) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief position information
////////////////////////////////////////////////////////////////////////////////
Position::Position (string const& function, string const& file, int line)
: _function(function), _file(file), _line(line) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the measure
////////////////////////////////////////////////////////////////////////////////
Measure::Measure (double measure, unit_e unit)
: _value(measure), _unit(unit) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the extra attribute
////////////////////////////////////////////////////////////////////////////////
Extra::Extra (size_t pos, string const& name)
: _position(pos), _name(name) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the extra attribute
////////////////////////////////////////////////////////////////////////////////
Extra::Extra (string const& name)
: _position(npos), _name(name) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the user identifier
////////////////////////////////////////////////////////////////////////////////
UserIdentifier::UserIdentifier (string const& name)
: _user(name) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief the info block
////////////////////////////////////////////////////////////////////////////////
Info::Info ()
: _messageIdentifier(),
_level(TRI_LOG_LEVEL_FATAL),
_category(TRI_LOG_CATEGORY_WARNING),
_severity(TRI_LOG_SEVERITY_UNKNOWN),
_functional(),
_peg(),
_task(),
_position(),
_measure(),
_extras(),
_userIdentifier(),
_processIdentifier(),
_prefix() {
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"
// End: