# |
Aug 15th 2019, 10:32 |
neothermic |
if you drop it, you get an error that there's no handler for that log type |
# |
Aug 15th 2019, 10:32 |
conehead |
Or can you get a list of all loggers with `CakeLog::configured` and then unset them via `CakeLog::drop($name)`? |
# |
Aug 15th 2019, 10:29 |
conehead |
Well usually it shouldnt at all...that is what mocks are for :P |
# |
Aug 15th 2019, 10:29 |
neothermic |
unsure how much cake might explode if I mock CakeLog |
# |
Aug 15th 2019, 10:28 |
conehead |
Unfortunately (or fortunately? :)) I do not have a cake 2 setup anymore. But shouldn't it be possible to mock out that darn logger? |
# |
Aug 15th 2019, 10:27 |
neothermic |
and neither is setting the Error up to be a file-only log :| |
# |
Aug 15th 2019, 10:26 |
neothermic |
aw, and `Cakelog::disable('Error');` is _not_ the answer :) |
# |
Aug 15th 2019, 10:24 |
challgren |
Damm |
# |
Aug 15th 2019, 10:23 |
neothermic |
nope, still. I put `Configure::write('debug', 0);` after the 'parent::setUp()' in my `setUp` and nada |
# |
Aug 15th 2019, 10:23 |
challgren |
*sits on edge of seat* |
# |
Aug 15th 2019, 10:23 |
challgren |
Damm |
# |
Aug 15th 2019, 10:23 |
neothermic |
oh, wait.. |
# |
Aug 15th 2019, 10:22 |
neothermic |
well, that didn't work |
# |
Aug 15th 2019, 10:22 |
challgren |
Or that |
# |
Aug 15th 2019, 10:22 |
neothermic |
ahh, I ponder if I should be running with debug = 0 during testing |
# |
Aug 15th 2019, 10:21 |
challgren |
Custom error handler during tests |
# |
Aug 15th 2019, 10:20 |
neothermic |
well, no, that only tells me _why_ it's writing to stderr, not how to stop it from doing so :) |
# |
Aug 15th 2019, 10:20 |
challgren |
Well that sounds like your fix! |
# |
Aug 15th 2019, 10:18 |
neothermic |
and in a console context, that writes to stderr |
# |
Aug 15th 2019, 10:18 |
neothermic |
which passes to ErrorHandler::handleError |
# |
Aug 15th 2019, 10:18 |
neothermic |
ahh, so I'm using cake's default error handler |
# |
Aug 15th 2019, 10:17 |
challgren |
Im trying to see where it even echos out |
# |
Aug 15th 2019, 10:17 |
neothermic |
file |
# |
Aug 15th 2019, 10:17 |
challgren |
Whats your engine? |
# |
Aug 15th 2019, 10:16 |
neothermic |
when you omit the scope, the type is used as the scope |
# |
Aug 15th 2019, 10:15 |
neothermic |
`CakeLog::write('error', '<some message>');` |
# |
Aug 15th 2019, 10:15 |
neothermic |
it's an error scope, FWIW |
# |
Aug 15th 2019, 10:15 |
challgren |
Im trying to recall what I did but I think it was scoping. To fix that |
# |
Aug 15th 2019, 10:14 |
neothermic |
so the logging is expected, but it being to the screen.. is not :P |
# |
Aug 15th 2019, 10:14 |
neothermic |
I'm intentionally checking paths that generate logs/return false/throw exceptions |
# |
Aug 15th 2019, 10:14 |
slackebot |
<challgren> |
# |
Aug 15th 2019, 10:14 |
neothermic |
PITA to see |
# |
Aug 15th 2019, 10:13 |
challgren |
Is it causing errors? Or just PITA to see |
# |
Aug 15th 2019, 10:13 |
neothermic |
nah, but ideally I don't want to change the code that I'm testing :S |
# |
Aug 15th 2019, 10:13 |
challgren |
Did you try scoping the write? |
# |
Aug 15th 2019, 10:12 |
neothermic |
heh |
# |
Aug 15th 2019, 10:12 |
challgren |
I thought you had cake 2 on cake 3 on cake 1! :P |
# |
Aug 15th 2019, 10:12 |
neothermic |
can we keep the jokes about 2.x being old until after it gets dropped from support? :P |
# |
Aug 15th 2019, 10:09 |
challgren |
@mrfeedback thanks for the sample! I was trying to figure out Policies |
# |
Aug 15th 2019, 10:09 |
mrfeedback |
thank you! |
# |
Aug 15th 2019, 10:09 |
mrfeedback |
oh man! you saved me again! overlooked that completley |