View previous topic :: View next topic |
Author |
Message |
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Sun Jan 22, 2006 12:33 am Post subject: Logging |
|
|
I think that logging/debug output is such an important thing, especially in tools like linkers, that it shouldn't be left in debug statements. Debug output can be really helpful when resolving linker errors (from an user's perspective), for example, and it should be available in release builds.
Should we consider using Mango.log, since we're already moving some other stuff over to Mango? |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Sun Jan 22, 2006 5:19 am Post subject: |
|
|
Sounds like a plan Lars.
Should we settle on some techniques or standards for logging things? IMO, we should probably keep it all to debug builds, and use some common way of identifying where log events are coming from. _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Sun Jan 22, 2006 5:25 am Post subject: |
|
|
pragma wrote: | Sounds like a plan Lars.
Should we settle on some techniques or standards for logging things? IMO, we should probably keep it all to debug builds, and use some common way of identifying where log events are coming from. |
Yeah, we should have something standardized.
But if we'll only have logging in debug builds, where should --verbose info come from? Users shouldn't need to have debug builds installed to get detailed info on what happens internally. And I'm talking about users of our internal tools, not of apps using DDL for plugins and whatnot. I doubt that the code will make any noticeable effect in any case. |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Sun Jan 22, 2006 6:15 am Post subject: |
|
|
larsivi wrote: | And I'm talking about users of our internal tools, not of apps using DDL for plugins and whatnot. I doubt that the code will make any noticeable effect in any case. |
Right. I was coming from making sure that there are ways to minimize the overall size of stuff compiled in. Being able to turn off logging will help.
How about a define like "DDLLogging" or something along those lines? _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Sun Jan 22, 2006 6:20 am Post subject: |
|
|
pragma wrote: | larsivi wrote: | And I'm talking about users of our internal tools, not of apps using DDL for plugins and whatnot. I doubt that the code will make any noticeable effect in any case. |
Right. I was coming from making sure that there are ways to minimize the overall size of stuff compiled in. Being able to turn off logging will help.
How about a define like "DDLLogging" or something along those lines? |
Ah, yes like having
-version=DDLLogging
when compiling apps where we want logging to be available? I suppose we should have the version statement inside the logging function so we don't need to wrap every call to logFunction with version statements? I guess an empty function will be optimized away in any case? |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Tue Jan 24, 2006 8:01 pm Post subject: |
|
|
larsivi wrote: |
Ah, yes like having
-version=DDLLogging
when compiling apps where we want logging to be available? I suppose we should have the version statement inside the logging function so we don't need to wrap every call to logFunction with version statements? I guess an empty function will be optimized away in any case? |
Honestly, I'm not sure how DMD likes to optimize away such dependencies. I know its a huge pain to use version() everywhere you should, but it really should be done in a polished version of the library. For now, I think your concept will work well. _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Wed Jan 25, 2006 1:15 am Post subject: |
|
|
pragma wrote: | larsivi wrote: |
Ah, yes like having
-version=DDLLogging
when compiling apps where we want logging to be available? I suppose we should have the version statement inside the logging function so we don't need to wrap every call to logFunction with version statements? I guess an empty function will be optimized away in any case? |
Honestly, I'm not sure how DMD likes to optimize away such dependencies. I know its a huge pain to use version() everywhere you should, but it really should be done in a polished version of the library. For now, I think your concept will work well. |
I already started to use version, so no worries |
|
Back to top |
|
|
|