Is there any documentation of LogUtil that I am missing? I have looked and found nothing. I can figure out the inline docs within the class, but my real question is this: Is LogUtil the way of the future? Is this this intended way to register module errors to the admin/user? It has been a while, but I thought I remembered some other way to do so in the past...
A page in the Wiki from some of our lead developers regarding which technologies/APIs we should be using as module developers would be helpful. e.g. "use LogUtil instead of SessionUtil to do xxx and yyy, but not zzz" would be helpful not only for LogUtil, but for any and all technologies present and planned would be great.
thanks!
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
LogUtil:: documentation? usage?
-
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
-
- Rank: Team Member
- Registered: Jan 05, 2003
- Posts: 776
Quote
Is LogUtil the way of the future?
Yes. The API should remain in place and it is the official thing to use since ZK 1.0. It is used throughout the core and in up-to-date 3rd party modules.
Quote
use LogUtil instead of SessionUtil to do xxx and yyy, but not zzz
You should use LogUtil::registerError() to display a red error to the user (which is displayed upon the next pageload).
You should use LogUtil::registerStatus() to display a green status message to the user (which is displayed upon the next pageload).
You should use LogUtil::registerPermissionError() to report permission errors (which is just an API wrapper around LogUtil::registerError()
You should use SessionUtil::* to store/load/delete module data that you need to persist behind the screens to session. For complex things is is much better than posting hidden variables or passing URL parameters.
You can configure LogUtil to write errors to a log file, but this is really only useful for debugging since these files can get very large. That part of LogUtil should be disabled in a productive setting. For most debugging situations just doing a print() and/or prayer() is faster/easier but there are some situations (such as requests triggered from remote sites where no output is displayed in your browser, some Ajax things) which make this part of LogUtil nice to have.
Hopefully that at least partially answers your questions. Yes, someone should write a Wiki page about this ...
Greetings
R -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
Quote
(which is displayed upon the next pageload)
should the results be displayed on any pageload? or only admin page loads? my module doesn't seem to display the results but when I go back to another page, I can seem them there. What do I need to insert in my template code? -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
- Moderated by:
- Support
