2

Generating and viewing debug logs in MavensMate has been clarified before and works great for me - I especially like the Scrub feature. However, I can't generate a log when I run unit tests.

To replicate my problem, here is a simple test:

@isTest
private class TestingTestClass {

    @isTest static void test_method_one() {
        System.debug('I would like to see this in my debug log');
        System.assertEquals(1, 1);
    }

}

Here is my configuration that is used by Quick Log to register the trace flag:

{
    "levels": {
        "Workflow": "INFO", 
        "Callout": "INFO", 
        "System": "DEBUG", 
        "Database": "INFO", 
        "ApexCode": "DEBUG", 
        "Validation": "INFO", 
        "Visualforce": "DEBUG"
    }, 
    "users": [
        "005i0000001qYYLAA2"
    ], 
    "expiration": 480
}

When I use my browser and go to Setup > Monitoring > Debug Logs I can see my trace flag correctly registered under monitored users and the filters are the same as specified.

To make sure this is in fact the user under which Unit Tests are run, I go to Setup > Develop > Apex Test Execution, run my sample test and check the username

Checking which user runs unit tests

The test run generate a debug log as expected.

So, I clear all the logs and from Sublime launch a Unit test run when I set the log level like this:

enter image description here

That does not generate any log output. (I do a fresh browse to Setup > Monitoring > Debug Logs and there are no logs)

Any help very much appreciated. Running Sublime Text, with MavensMate v3.5.0 talking to a Salesforce sandbox on Summer 14

4

Usually I get the logs in these tab that opens on the far right of hitherto screenshot you showed...there's about 5 things in there, including the debug, code coverage, and some other things.

  • 1
    Aha! That little triangle on the Test Results tab - indeed it opens up a whole world of information. Very useful. Couldn't find anything about it in the documentation. Thanks, Shane! – JannieT Jul 21 '14 at 4:56
2

Here's a screen capture to go with @Shane's response:

Mavens Test Results Image

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.