VirtueMart - 1.0 Guida Utente Pagina 8

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 19
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 7
"Logging" means to log a message to display them to the user. While a function is executed (because its execu-
tion was triggered by the variable $func) in the file virtuemart_parser.php, the events are buffered.
When the function call has ended, the contents of the log are flushed and all messages are displayed to the user
in the order they were added to the log: first in, first out.
After that implicit flushing is enabled - what means that you can log a message and it is printed into the HTML
code where you call the log function.
Currently the Log_display class used by VM offers 9 log levels:
System is unusable (PEAR_LOG_EMERG)
Immediate action required (PEAR_LOG_ALERT)
Critical conditions (PEAR_LOG_CRIT), formatted by CSS style log_crit
Error conditions (PEAR_LOG_ERR), formatted by CSS style log_error
Warning conditions (PEAR_LOG_WARNING), formatted by CSS style log_warning
Normal but significant (PEAR_LOG_NOTICE)
Informational (PEAR_LOG_INFO), formatted by CSS style log_info
Debug-level messages (PEAR_LOG_DEBUG) formatted by CSS style log_debug
Advice messages (PEAR_LOG_TIP, added for VM), formatted by CSS style log_tip
Please note that Debug log entries are only shown to the user, when DEBUG is enabled by configuration.
To log an event, you can use a special function for each log level:
$vmLogger->emerg( 'My emergency message to the user' );
$vmLogger->alert( 'My alarm message to the user' );
$vmLogger->crit( 'My critical message to the user' );
$vmLogger->err( 'My error message to the user' ); // Mainly used to log errors in a function
$vmLogger->warning( 'My warning message to the user' ); // Mainly used to trigger warnings
$vmLogger->notice( 'My Notice to the user' );
$vmLogger->info( 'My informational message to the user' ); // Used to give success messages
$vmLogger->debug( 'My debug message to the user' ); // Only displayed when DEBUG is enabled
VirtueMart Developer Manual
8
Vedere la pagina 7
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 18 19

Commenti su questo manuale

Nessun commento