FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Logging

 
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries
View previous topic :: View next topic  
Author Message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Sun Jan 22, 2006 12:33 am    Post subject: Logging Reply with quote

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
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Sun Jan 22, 2006 5:19 am    Post subject: Reply with quote

Sounds like a plan Lars. Smile

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
View user's profile Send private message Yahoo Messenger
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Sun Jan 22, 2006 5:25 am    Post subject: Reply with quote

pragma wrote:
Sounds like a plan Lars. Smile

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
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Sun Jan 22, 2006 6:15 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Sun Jan 22, 2006 6:20 am    Post subject: Reply with quote

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
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Tue Jan 24, 2006 8:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Wed Jan 25, 2006 1:15 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group