sandbox_logging.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef SANDBOX_MAC_SANDBOX_LOGGING_H_
  5. #define SANDBOX_MAC_SANDBOX_LOGGING_H_
  6. namespace sandbox {
  7. // Sandbox has its own logging implementation to avoid linking against //base.
  8. // Sandbox should not link against libbase because libbase brings in numerous
  9. // system libraries that increase the attack surface of the sandbox code.
  10. namespace logging {
  11. // The follow three functions log a format string and its arguments at
  12. // the platform specific version of the given log levels.
  13. void Info(const char* fmt, ...);
  14. void Warning(const char* fmt, ...);
  15. void Error(const char* fmt, ...);
  16. // This logs a platform specific critical message and aborts the process.
  17. void Fatal(const char* fmt, ...);
  18. // The PError and PFatal functions log the errno information as well.
  19. void PError(const char* fmt, ...);
  20. void PFatal(const char* fmt, ...);
  21. } // namespace logging
  22. } // namespace sandbox
  23. #endif // SANDBOX_MAC_SANDBOX_LOGGING_H_