Scol standard library package  0.3.1
Common and usefull functions for all Scol applications
Classes | Typedefs | Functions | Variables
error.pkg File Reference

Scol Standard Library - Error API. More...

Classes

struct  STD_ERROR
 Opaque internal structure. You should not call it directly, use API instead ! More...
 

Typedefs

typedef struct mkSTD_ERROR STD_ERROR
 

Functions

 std_errAddType (err, num, str)
 Add a new predefined error in a manager. More...
 
 std_errcheckfilename (filename)
 
 std_errClearTypes (err)
 Reset all predefined error in a manager. More...
 
 std_errClose (err)
 Close a manager. If TMPFILE is enabled, the temporary file is closed and its content is lost. More...
 
 std_errCopy (err, filename)
 Open a new manager in copying the configuration of another one. More...
 
 std_errGetConsole (err)
 Returns if the Scol console is shown (for this manager) Only if this API manages the Scol console, if another code show or hide it, this return can be wrong. More...
 
 std_errGetContent (err)
 Returns the content of the log file (for a manager) This can be a hard file or a temporary file. More...
 
 std_errGetEnabled (err)
 Returns the current state of a manager. More...
 
 std_errGetFilename (err)
 Returns the path of the log file of a manager. More...
 
 std_errGetFoo (err)
 Returns if, for a manager, the message are displayed in the Scol console. More...
 
 std_errGetIsTemp (err)
 Returns if a temporary file is used (for a manager) More...
 
 std_errGetLast (err)
 Returns the last written message. More...
 
 std_errGetMask (err)
 Returns the current mask of a manager. More...
 
 std_errGetObjDisabled ()
 Returns a list of all manager disabled. More...
 
 std_errgetobjenabled (list, a)
 
 std_errGetObjEnabled ()
 Returns a list of all manager enabled. More...
 
 std_errgetobjenabled2 (a)
 
 std_errGetPeriod (err)
 Get the period. Period is unused, so this function is unused too ! More...
 
 std_errGetTypeFromNumber (err, number)
 Returns the string error message for a given number code error (for a manager) More...
 
 std_errgettypefromstring (list, str)
 
 std_errGetTypeFromString (err, str)
 Returns the number code error from a given string error message (for a manager) More...
 
 std_errGetTypes (err)
 Returns the list of defined eror types for a manager. More...
 
 std_errnewtemp (err, str)
 
 std_errNumber (err, num, mask)
 Send a predefined error to a manager. According the manager settings, the string can be written in the Scol console, in the application log file if the client set it, in the customized log file, ... More...
 
 std_errNumberAndInConsole (err, csl, num, mask)
 Same thing than std_errNumber. In addition, you can print the message error in a EasyConsole (see in lib/console directory) More...
 
 std_errObjLast ()
 Returns the last created(opened) manager. More...
 
 std_errObjNumbers ()
 Return the number of opened managers. More...
 
 std_errOpen (mask)
 Open a new manager By default, the manager is ENABLED, the console message and the console are disabled. Other parameters are at nil. More...
 
 std_errOpenLog (err, filename)
 Open a new log file The current date is written. More...
 
 std_errOpenLogNow (err, name)
 Open a new log file. The filename is the current date and time with a prefix : my_folder/the_prefix_2013_12_14-17_25_21.log The current date is written. The TMPFILE must be disabled. More...
 
 std_errprint (err, num, str, mask)
 
 std_errremovetype (tuple, e)
 
 std_errRemoveType (err, num)
 Remove a predefined error in a manager. More...
 
 std_errSaveTemp (err, filename)
 A conivience function. Save the content of the temporary file in a hard file. More...
 
 std_errSetConsole (err, state)
 Set the state of the Scol console if another code show or hide it, the effect can be different. More...
 
 std_errSetEnabled (err, state)
 Set the current state of a manager. More...
 
 std_errSetFoo (err, state)
 Set if error message are displayed in the Scol console. More...
 
 std_errSetIsTemp (err, isTmp, filename)
 Set if a manager uses (or not) a temporary file. If the old and the new value are the same, no change is done. If the new value is 1 and the old value was 0, a new temporary file is created and the content of the old 'hard' file is copied in the new temporary file. The old 'hard' file is unchanged and no new message will be written. If the new file is 0 and the 'hard' file name is not nil, the file is created and the content of the old temporary file is copied. This last one is closed (and destroyed). All other configuration or an invalid argument will return a nil value. More...
 
 std_errSetMask (err, mask)
 Set the current mask of a manager. More...
 
 std_errsettemptoend (err)
 
 std_errString (err, str, mask)
 Send a new string message error to a manager. According the manager settings, the string can be written in the Scol console, in the application log file if the client set it, in the customized log file, ... More...
 
 std_errStringAndInConsole (err, csl, str, mask)
 Same thing than std_errString. In addition, you can print the string message error in a EasyConsole (see in lib/console directory) More...
 
 std_errUndoMask (err)
 Perform an 'undo' to the mask of a manager. More...
 

Variables

proto console_print =fun [CONSOLE S] I
 
_getmodifypack filename
 
typeof StdErrList =[STD_ERROR r1]
 

Detailed Description

Scol Standard Library - Error API.

Author
Scol team
Version
0.2
Warning
This API requires sprintf, currently in Syspack Scol library.
To use it with the Console library (lib/console), this API requires too the lib/console/console.pkg package.

This API provides an high level method to easily include a customized error manager

You can :

It is NOT recommanded to use the internal STD_ERROR structure to any application. Use this API instead.

Variable Documentation

StdErrList =[STD_ERROR r1]

List of all managers created. No use directly