Path: blob/master/thirdparty/graphite/include/graphite2/Log.h
9906 views
/* SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later */1/* Copyright 2010, SIL International, All rights reserved. */2#pragma once34#include <graphite2/Types.h>5#include <graphite2/Font.h>6#include <stdio.h>78#ifdef __cplusplus9extern "C"10{11#endif1213/** deprecated mechanism that doesn't do anything now. */14typedef enum {15GRLOG_NONE = 0x0,16GRLOG_FACE = 0x01,17GRLOG_SEGMENT = 0x02,18GRLOG_PASS = 0x04,19GRLOG_CACHE = 0x08,2021GRLOG_OPCODE = 0x80,22GRLOG_ALL = 0xFF23} GrLogMask;2425/** Start logging all segment creation and updates on the provided face. This26* is logged to a JSON file, see "Segment JSON Schema.txt" for a precise27* definition of the file28*29* @return true if the file was successfully created and logging is correctly30* initialised.31* @param face the gr_face whose segments you want to log to the given file32* @param log_path a utf8 encoded file name and path to log to.33*/34GR2_API bool gr_start_logging(gr_face * face, const char *log_path);353637/** Stop logging on the given face. This will close the log file created by38* gr_start_logging.39*40* @param face the gr_face whose segments you want to stop logging41*/42GR2_API void gr_stop_logging(gr_face * face);4344/** Start logging to a FILE object.45* This function is deprecated as of 1.2.0, use the _face versions instead.46*47* @return True on success48* @param logfile FILE reference to output logging to49* @param mask What aspects of logging to report (ignored)50*/51GR2_API bool graphite_start_logging(FILE * logFile, GrLogMask mask); //may not do anthing if disabled in the implementation of the engine.5253/** Stop logging to a FILE object.54* This function is deprecated as of 1.2.0, use the _face versions instead.55*/56GR2_API void graphite_stop_logging();5758#ifdef __cplusplus59}60#endif616263