@rbxts/rlog > SerializationConfig > encodeFunctions
SerializationConfig.encodeFunctions property
Whether to encode function types.
Signature:
readonly encodeFunctions: boolean;
Remarks
When this setting is disabled, all function types will be represented as "<Function>"
. Otherwise, they'll be excluded from the outputted JSON.
Example
function createPlayer(name: string) {
return {
name: name,
eatFood: () => {
// ...
}
}
}
const player = createPlayer("daymon");
let logger = new RLog({ serialization: { encodeFunctions: true } });
logger.i("Player created", { player: player });
// > [INFO]: Player created
// > { "data": { "player": { "name": "daymon", "eatFood": "<Function>" } } }
logger = new RLog({ serialization: { encodeFunctions: false } });
logger.i("Player created", { player: player });
// > [INFO]: Player created
// > { "data": { "player": { "name": "daymon" } } }