Project

General

Profile

Scol standard library package  0.3.1
Common and usefull functions for all Scol applications
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.
 std_errcheckfilename (filename)
 std_errClearTypes (err)
 Reset all predefined error in a manager.
 std_errClose (err)
 Close a manager. If TMPFILE is enabled, the temporary file is closed and its content is lost.
 std_errCopy (err, filename)
 Open a new manager in copying the configuration of another one.
 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.
 std_errGetContent (err)
 Returns the content of the log file (for a manager) This can be a hard file or a temporary file.
 std_errGetEnabled (err)
 Returns the current state of a manager.
 std_errGetFilename (err)
 Returns the path of the log file of a manager.
 std_errGetFoo (err)
 Returns if, for a manager, the message are displayed in the Scol console.
 std_errGetIsTemp (err)
 Returns if a temporary file is used (for a manager)
 std_errGetLast (err)
 Returns the last written message.
 std_errGetMask (err)
 Returns the current mask of a manager.
 std_errGetObjDisabled ()
 Returns a list of all manager disabled.
 std_errgetobjenabled (list, a)
 std_errGetObjEnabled ()
 Returns a list of all manager enabled.
 std_errgetobjenabled2 (a)
 std_errGetPeriod (err)
 Get the period. Period is unused, so this function is unused too !
 std_errGetTypeFromNumber (err, number)
 Returns the string error message for a given number code error (for a manager)
 std_errgettypefromstring (list, str)
 std_errGetTypeFromString (err, str)
 Returns the number code error from a given string error message (for a manager)
 std_errGetTypes (err)
 Returns the list of defined eror types for a manager.
 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, ...
 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)
 std_errObjLast ()
 Returns the last created(opened) manager.
 std_errObjNumbers ()
 Return the number of opened managers.
 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.
 std_errOpenLog (err, filename)
 Open a new log file The current date is written.
 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.
 std_errprint (err, num, str, mask)
 std_errremovetype (tuple, e)
 std_errRemoveType (err, num)
 Remove a predefined error in a manager.
 std_errSaveTemp (err, filename)
 A conivience function. Save the content of the temporary file in a hard file.
 std_errSetConsole (err, state)
 Set the state of the Scol console if another code show or hide it, the effect can be different.
 std_errSetEnabled (err, state)
 Set the current state of a manager.
 std_errSetFoo (err, state)
 Set if error message are displayed in the Scol console.
 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.
 std_errSetMask (err, mask)
 Set the current mask of a manager.
 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, ...
 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)
 std_errUndoMask (err)
 Perform an 'undo' to the mask of a manager.

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 :

  • define your masks yourself
  • enabled / disabled this manager
  • define your code numbers and messages error
  • write - or not - in the Scol console
  • use a hard file log or a temporary file log
  • and more things yet

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