You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

  1. // base/kaldi-error.cc
  2. // Copyright 2019 LAIX (Yi Sun)
  3. // Copyright 2019 SmartAction LLC (kkm)
  4. // Copyright 2016 Brno University of Technology (author: Karel Vesely)
  5. // Copyright 2009-2011 Microsoft Corporation; Lukas Burget; Ondrej Glembek
  6. // See ../../COPYING for clarification regarding multiple authors
  7. //
  8. // Licensed under the Apache License, Version 2.0 (the "License");
  9. // you may not use this file except in compliance with the License.
  10. // You may obtain a copy of the License at
  11. //
  12. // http://www.apache.org/licenses/LICENSE-2.0
  13. //
  14. // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16. // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17. // MERCHANTABLITY OR NON-INFRINGEMENT.
  18. // See the Apache 2 License for the specific language governing permissions and
  19. // limitations under the License.
  20. #include "base/kaldi-error.h"
  21. #include <string>
  22. namespace kaldi {
  23. /***** GLOBAL VARIABLES FOR LOGGING *****/
  24. int32 g_kaldi_verbose_level = 0;
  25. static std::string program_name; // NOLINT
  26. void SetProgramName(const char* basename) {
  27. // Using the 'static std::string' for the program name is mostly harmless,
  28. // because (a) Kaldi logging is undefined before main(), and (b) no stdc++
  29. // string implementation has been found in the wild that would not be just
  30. // an empty string when zero-initialized but not yet constructed.
  31. program_name = basename;
  32. }
  33. } // namespace kaldi