| 1 | /* SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later */ |
| 2 | /* Copyright 2010, SIL International, All rights reserved. */ |
| 3 | #pragma once |
| 4 | |
| 5 | #include <graphite2/Types.h> |
| 6 | #include <graphite2/Font.h> |
| 7 | #include <stdio.h> |
| 8 | |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" |
| 11 | { |
| 12 | #endif |
| 13 | |
| 14 | /** deprecated mechanism that doesn't do anything now. */ |
| 15 | typedef enum { |
| 16 | GRLOG_NONE = 0x0, |
| 17 | GRLOG_FACE = 0x01, |
| 18 | GRLOG_SEGMENT = 0x02, |
| 19 | GRLOG_PASS = 0x04, |
| 20 | GRLOG_CACHE = 0x08, |
| 21 | |
| 22 | GRLOG_OPCODE = 0x80, |
| 23 | GRLOG_ALL = 0xFF |
| 24 | } GrLogMask; |
| 25 | |
| 26 | /** Start logging all segment creation and updates on the provided face. This |
| 27 | * is logged to a JSON file, see "Segment JSON Schema.txt" for a precise |
| 28 | * definition of the file |
| 29 | * |
| 30 | * @return true if the file was successfully created and logging is correctly |
| 31 | * initialised. |
| 32 | * @param face the gr_face whose segments you want to log to the given file |
| 33 | * @param log_path a utf8 encoded file name and path to log to. |
| 34 | */ |
| 35 | GR2_API bool gr_start_logging(gr_face * face, const char *log_path); |
| 36 | |
| 37 | |
| 38 | /** Stop logging on the given face. This will close the log file created by |
| 39 | * gr_start_logging. |
| 40 | * |
| 41 | * @param face the gr_face whose segments you want to stop logging |
| 42 | */ |
| 43 | GR2_API void gr_stop_logging(gr_face * face); |
| 44 | |
| 45 | /** Start logging to a FILE object. |
| 46 | * This function is deprecated as of 1.2.0, use the _face versions instead. |
| 47 | * |
| 48 | * @return True on success |
| 49 | * @param logfile FILE reference to output logging to |
| 50 | * @param mask What aspects of logging to report (ignored) |
| 51 | */ |
| 52 | GR2_API bool graphite_start_logging(FILE * logFile, GrLogMask mask); //may not do anthing if disabled in the implementation of the engine. |
| 53 | |
| 54 | /** Stop logging to a FILE object. |
| 55 | * This function is deprecated as of 1.2.0, use the _face versions instead. |
| 56 | */ |
| 57 | GR2_API void graphite_stop_logging(); |
| 58 | |
| 59 | #ifdef __cplusplus |
| 60 | } |
| 61 | #endif |
| 62 | |