diff options
Diffstat (limited to 'helium/debugging.cpp')
-rw-r--r-- | helium/debugging.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/helium/debugging.cpp b/helium/debugging.cpp new file mode 100644 index 0000000..221c495 --- /dev/null +++ b/helium/debugging.cpp @@ -0,0 +1,31 @@ +// Copyright 2006 Google Inc. +// All Rights Reserved. +// Author: <renn@google.com> (Marius Renn) +// +#include "debugging.h" + +// C includes +#include <stdio.h> +#include <stdlib.h> + +void helium::AssertionFunction(bool assertion, + const char* assertion_string, + unsigned line, + const char* file) { + if (!assertion) { + printf("%s, %d] ASSERTION (%s) FAILED!\n", file, line, assertion_string); + exit(-1); + } +} + +void helium::LogMessageFunction(const char* message, + unsigned line, + const char* file) { + printf("%s, %d] %s\n", file, line, message); +} + +void helium::ErrorMessageFunction(const char* message, + unsigned line, + const char* file) { + fprintf(stderr, "%s, %d] %s\n", file, line, message); +} |