Chromium Code Reviews| Index: mojo/public/c/environment/logger.h |
| diff --git a/mojo/public/c/environment/logger.h b/mojo/public/c/environment/logger.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fd9a88fc6f4bbad7a830dcc41ee16ef5870c861d |
| --- /dev/null |
| +++ b/mojo/public/c/environment/logger.h |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MOJO_PUBLIC_C_ENVIRONMENT_LOGGER_H_ |
| +#define MOJO_PUBLIC_C_ENVIRONMENT_LOGGER_H_ |
| + |
| +#include <stdint.h> |
| + |
| +// |MojoLogLevel|: Used to specify the type of log message. Values are ordered |
| +// by severity (i.e., higher numerical values are more severe). |
| + |
| +typedef int32_t MojoLogLevel; |
| + |
| +#ifdef __cplusplus |
| +const MojoLogLevel MOJO_LOG_LEVEL_VERBOSE = -1; |
| +const MojoLogLevel MOJO_LOG_LEVEL_INFO = 0; |
| +const MojoLogLevel MOJO_LOG_LEVEL_WARNING = 1; |
| +const MojoLogLevel MOJO_LOG_LEVEL_ERROR = 2; |
| +const MojoLogLevel MOJO_LOG_LEVEL_FATAL = 3; |
| +#else |
| +#define MOJO_LOG_LEVEL_INFO ((MojoLogLevel) 0) |
|
darin (slow to review)
2014/06/14 06:08:23
MOJO_LOG_LEVEL_VERBOSE needed for the C case too?
|
| +#define MOJO_LOG_LEVEL_WARNING ((MojoLogLevel) 1) |
| +#define MOJO_LOG_LEVEL_ERROR ((MojoLogLevel) 2) |
| +#define MOJO_LOG_LEVEL_FATAL ((MojoLogLevel) 3) |
| +#endif |
| + |
| +struct MojoLogger { |
| + void (*LogMessage)(MojoLogLevel log_level, const char* message); |
| +}; |
| + |
| +#endif // MOJO_PUBLIC_C_ENVIRONMENT_LOGGER_H_ |