FCF 2.0 development in progress...
> > > > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

"message_before" event of base class fcf.EventEmitter (class fcf.Logger)

Event: message_before

Package: fcf-framework-core

Available from version: 2.0.2

Message logging event. Called before output and call of logger handlers

Event arguments
object a_info
- information object
  • integer level - Logging level

  • string module - The name of the module from which the logging is called

  • string output - Prefixed output message (populated by handlers)

  • string message - Displaying a message without prefixes (filled in by the fcf.Logger.messageHandler handler)

  • [mixed] args - Arguments passed to logger for output

  • fcf.Logger logger - Pointer to logger object

  • boolean break - If true, then further execution of handlers is interrupted

Example: Application

fcf.log.on("message_before", (a_info)=>{ console.log(a_info.args); }); fcf.log.tst("Application", "Hello world!");

Output:

[ 'Hello world!' ] 2023-04-18 13:44:40.794 [PID:23281] [TST] [MOD:Application]: Hello world!