Expand description
Logger for Azure Function Custom Handler, abusing the undocumented (at least I don’t know where) rule of Azure Function “infering” the log level from stderr.
For custom handler, if you print a message to stdout, it will be considered as a Information
level log by Azure Function runtime.
If you print a message to stderr, then it will be consider Error
if it does not contain warn
(case insensitive),
otherwise it will be Warning
.
So the strategy is, for error-level log, if warn
occurs, base64-encode it, if the encoded string still contains warn
,
base-encode again, and if the twice-encoded string still contains warn
(which should be impossible), log an error explain that the
following warning is error, then log it as a warning. For warning-level log, if warn
does not occur, add a warning:
prefix.
You can initialize the log by init. You can also implement your own transform logic by implementing Transform trait and passing it to init_transform.
Structs§
Traits§
Functions§
- Returns true if the message contains
warn
(case insensitive).