File: LoggerTypes.cpp

package info (click to toggle)
vecgeom 1.2.8%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 24,016 kB
  • sloc: cpp: 88,803; ansic: 6,888; python: 1,035; sh: 582; sql: 538; makefile: 23
file content (28 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//----------------------------------*-C++-*----------------------------------//
// Copyright 2020-2023 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file LoggerTypes.cpp
//---------------------------------------------------------------------------//
#include "VecGeom/management/LoggerTypes.h"

#include <cassert>

namespace vecgeom {

//---------------------------------------------------------------------------//
/*!
 * Get the plain text equivalent of the LogLevel enum.
 */
char const *to_cstring(LogLevel lev)
{
  static const char *const data[] = {
      "debug", "diagnostic", "status", "info", "warning", "error", "critical",
  };
  assert(size_t(lev) * sizeof(const char *) < sizeof(data));
  return data[static_cast<int>(lev)];
}

//---------------------------------------------------------------------------//
} // namespace vecgeom