Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printer.log.keepAutoTracing = true not working #2

Closed
francobellu opened this issue Jul 11, 2017 · 1 comment
Closed

Printer.log.keepAutoTracing = true not working #2

francobellu opened this issue Jul 11, 2017 · 1 comment
Assignees
Labels

Comments

@francobellu
Copy link

francobellu commented Jul 11, 2017

I have set the keepAutoTracing variable to true and was expecting to get all the functions calls logged automatically without the need to manually call Printer.log.trace() but that is not the case.

How is it supposed to work?

Also, I normally need to log the function entry point as well as the exit point. I normally print logs along the line of:

Myclass.Start(): IN
---
---
---
---
---
---
Myclass.Start(): OUT

this way I'm able to mentally follow the flow of execution. Is there any way to achieve this behavior with your framework?

@hemangshah hemangshah self-assigned this Jul 12, 2017
@hemangshah
Copy link
Owner

hemangshah commented Jul 12, 2017

keepAutoTracing is true by default means you should only set it if you want to disable it. The purpose of the property is to keep logging the filename, function name and line number from where you have asked Printer to log.

Printer is created with the goal to print fancy logs by replacing the traditional 'print( )`. I am afraid that what you're looking for is not supported and surely wouldn't available in future versions.

However, you can always manually do it for individual functions.

func test() -> Void {
    Printer.log.alert(details: "IN")
    .....
    .....
    .....
    Printer.log.alert(details: "OUT")
}

Thanks for trying Printer, for now, I am closing this issue, you can try other features and if you found anything please feel free to open an issue again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants