1
0
Fork 0
arangodb/Basics/LoggerData.cpp

215 lines
7.3 KiB
C++

////////////////////////////////////////////////////////////////////////////////
/// @brief logger info
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2010-2011 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-2011, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
#include "LoggerInfo.h"
using namespace triagens::basics;
using namespace triagens::basics::LoggerData;
using namespace std;
// -----------------------------------------------------------------------------
// --SECTION-- 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: