diff --git a/README.md b/README.md index 307fa2d836..d177de5abf 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ List of Definitions * [jQuery UI](http://jqueryui.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [jQuery.BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (by [Adam R. Smith](https://github.com/sunetos)) * [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/)) +* [jQuery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging/) (by [Diullei Gomes](https://github.com/diullei/)) * [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode)) * [jQuery.dynatree](http://code.google.com/p/dynatree/) (by [François de Campredon](https://github.com/fdecampredon)) * [jQuery.Flot](http://www.flotcharts.org/) (by [Matt Burland](https://github.com/burlandm)) diff --git a/jquery.clientSideLogging/jquery.clientSideLogging-tests.ts b/jquery.clientSideLogging/jquery.clientSideLogging-tests.ts new file mode 100644 index 0000000000..a4abf87bba --- /dev/null +++ b/jquery.clientSideLogging/jquery.clientSideLogging-tests.ts @@ -0,0 +1,24 @@ +/// + +interface JQueryStatic { + info: (what?: any) => any; + error: (what?: any) => any; + log: (what?: any) => any; + clientSideLogging: (options: ClientSideLoggingObject) => any; +} + +$.clientSideLogging({ + log_level: 3, + client_info: { + location:true, + screen_size:true, + user_agent:true, + window_size:false + } +}); + +$.info({msg:$(this).parents('li').find('input:text').val()}); +$.error({msg:$(this).parents('li').find('input:text').val()}); +$.log($(this).parents('li').find('input:text').val()); + +$.post('/log?type=error&msg=YOUR_ERROR_MESSAGE'); \ No newline at end of file diff --git a/jquery.clientSideLogging/jquery.clientSideLogging.d.ts b/jquery.clientSideLogging/jquery.clientSideLogging.d.ts new file mode 100644 index 0000000000..6ea97ef106 --- /dev/null +++ b/jquery.clientSideLogging/jquery.clientSideLogging.d.ts @@ -0,0 +1,24 @@ +// Type definitions for jquery.clientSideLogging. +// Project: https://github.com/remybach/jQuery.clientSideLogging +// Definitions by: Diullei Gomes +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface ClientSideLoggingClientInfoObject { + location?: bool; // The url to the page on which the error occurred. + screen_size?: bool; // The size of the user's screen (different to the window size because the window might not be maximized) + user_agent?: bool; // The user agent string. + window_size?: bool; // The window size. +} + +interface ClientSideLoggingObject { + error_url?: string; // The url to which errors logs are sent + info_url?: string; // The url to which info logs are sent + log_url?: string; // The url to which standard logs are sent + log_level?: number; // The level at which to log. This allows you to keep the calls to the logging in your code and just change this variable to log varying degrees. 1 = only error, 2 = error & log, 3 = error, log & info + native_error?: bool; // Whether or not to send native js errors as well (using window.onerror). + hijack_console?: bool; // Hijacks the default console functionality (ie: all your console.error/info/log are belong to us). + query_var?: string; // The variable to send the log message through as. + client_info?: ClientSideLoggingClientInfoObject; // Configuration for what info about the client's browser is logged. +}