Module: MongoActions

Includes:
Colors
Included in:
MongoBeautifulLogger
Defined in:
lib/mongo_beautiful_logger/mongo_actions.rb

Constant Summary collapse

FIND =

substring matches and the corresponding colors for mongodb actions

{ match: "\"find\"=>",        color: BLUE }
UPDATE =
{ match: "\"update\"=>",      color: YELLOW }
INSERT =
{ match: "\"insert\"=>",      color: GREEN }
DELETE =
{ match: "\"delete\"=>",      color: RED }
AGGREGATE =
{ match: "\"aggregate\"=>",   color: MAGENTA }
SUCCEEDED =
{ match: "succeeded",         color: GREEN }
FAILED =
{ match: "failed",            color: RED }
ERROR =
{ match: "error",             color: RED }
ENDSESSION =
{ match: "\"endsessions\"=>", color: YELLOW }
ACTIONS =
[ FIND, UPDATE, INSERT, DELETE, AGGREGATE, 
SUCCEEDED, FAILED, ERROR, ENDSESSION ]
UNNECESSARY =

substring matches for unnecessary log messages that will be filtered out

["opology", "server description"]
PREFIX_REGEX =

regex for for the log prefix that will be filtered out matches: | localhost:27017 | app_test.update | STARTED | note: | STARTED | and | SUCCEEDED | will be filtered due to redundancy, but | FAILED | and others will not

/\|.*?\|.*?\|( (SUCCEEDED|STARTED) \|)?/

Constants included from Colors

Colors::BLACK, Colors::BLUE, Colors::BOLD, Colors::CLEAR, Colors::CYAN, Colors::GREEN, Colors::MAGENTA, Colors::RED, Colors::WHITE, Colors::YELLOW