Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node. Original corpo Bitbucket history not included — clean archive commit.
This commit is contained in:
74
stubs/testLogger.php
Normal file
74
stubs/testLogger.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mshallop
|
||||
* Date: 7/6/17
|
||||
* Time: 2:02 PM
|
||||
*/
|
||||
require_once(dirname(__DIR__) . '/config/sneakerstrap.inc');
|
||||
|
||||
$meta = [
|
||||
META_TEMPLATE => TEMPLATE_CLASS_LOGS,
|
||||
META_CLIENT => CLIENT_SYSTEM
|
||||
];
|
||||
$errors = array();
|
||||
$foo = new gacFactory($meta, FACTORY_EVENT_NEW_CLASS, '', $errors);
|
||||
|
||||
/** @var gacMongoDB $bar */
|
||||
$bar = $foo->widget;
|
||||
//$bar->logger->metrics('metrics test test check one two', 0.00123, $errors);
|
||||
|
||||
// find({ level_log: { $eq : "warning" }})
|
||||
$query = [
|
||||
LOG_LEVEL => [
|
||||
OPERAND_NULL => [
|
||||
OPERATOR_EQ => [ "warning" ]
|
||||
]
|
||||
]
|
||||
];
|
||||
$mongoQuery = $bar->gwValidateQuery($query);
|
||||
//if (empty($mongoQuery))
|
||||
// var_dump($bar->eventMessages);
|
||||
//else
|
||||
// var_dump($mongoQuery);
|
||||
|
||||
|
||||
// find({ $or : [ { level_log : {$eq : 'warning'}}, {level_log: {$eq: 'fatal'}}]})
|
||||
$query = [
|
||||
LOG_LEVEL => [
|
||||
OPERAND_OR => [
|
||||
OPERATOR_EQ => [ "warning", "fatal" ]
|
||||
]
|
||||
]
|
||||
];
|
||||
$mongoQuery = $bar->gwValidateQuery($query);
|
||||
//if (empty($mongoQuery))
|
||||
// var_dump($bar->eventMessages);
|
||||
//else
|
||||
// var_dump($mongoQuery);
|
||||
|
||||
|
||||
/*
|
||||
* find({ $or : [
|
||||
* { $or : [ { level_log: { $eg : 'warning'}}, {level_log: {$eg: 'fatal'}} ] },
|
||||
* { $gte : { levelValue_log : { $gte: 3 }}}
|
||||
* ]
|
||||
*/
|
||||
$query = [
|
||||
LOG_LEVEL => [ OPERAND_OR => [ OPERATOR_EQ => ['warning', 'fatal']]], // same as above
|
||||
LOG_VALUE => [ OPERAND_NULL => [ OPERATOR_GTE => [3]]],
|
||||
OPERAND_OR => null
|
||||
];
|
||||
$mongoQuery = $bar->gwValidateQuery($query);
|
||||
$bar->logger->debug('message DEBUG');
|
||||
$bar->logger->info('message INFO');
|
||||
$bar->logger->data('message DATA');
|
||||
$bar->logger->error('message ERROR');
|
||||
$bar->logger->warn('message WARN');
|
||||
$bar->logger->fatal('message FATAL');
|
||||
$bar->logger->metrics('message METRICS', 0.226622);
|
||||
|
||||
//if (empty($mongoQuery))
|
||||
// var_dump($bar->eventMessages);
|
||||
//else
|
||||
// var_dump($mongoQuery);
|
||||
Reference in New Issue
Block a user