<commit_before>﻿@using ViewExtensions
@using WebSite.App_Code

@{
    ViewBag.Title = "JSNLog - Better JavaScript Logging";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section Hero {
    <section class="hero large-text">
        <section class="benefits" style="float: left; width: 650px; margin-top: 5px;">
            <h1>Client side logging integrated with ASP.NET and MVC</h1>
            <p>
            JSNLog lets you insert loggers in your client side JavaScript,
            configure them in your web.config, and store their messages
            in your server side logs - without any server side coding.
            </p>
        </section>
<div class="download" style="float: right; margin-bottom: 10px;"> 
        @Html.Raw(Html.Partial("Partials/_DownloadButton").ToHtmlString())
        </div>

        @if (PageVersions.CurrentVersion() == "NetJs")
        {
            <div class="nugetline">PM> Install-Package JSNLog</div>
        }

    </section>
}

<section class="features">
    <div class="leftColumn">

    @Feature(
        "",
        @"Works with your server side loggers",
        @"<ul class=""halfspaced"">
        <li>
Sends log messages from the client to the server using AJAX.
        </li>
        <li>
Hands the log messages to your server side logging package.
        </li>
        <li>
Supports Log4Net, NLog, Elmah, Common.Logging.
        </li>
        </ul>")

        @Feature(
            "",
            @"Insert loggers in your JavaScript",
            @"<pre>JL(""jsLogger"").fatal(""log message"");</pre>")

    @Feature(
        "",
        @"Configure loggers in your web.config",
        @"<pre>&lt;logger name=""jslogger"" level=""FATAL"" /&gt;</pre>
")

    @Feature(
        "",
        @"Or configure them in your JavaScript code",
        @"<pre>JL(""jsLogger"").setOptions({ ""level"": 4000 });</pre>
")

    @Feature(
        "",
        @"Reduce AJAX requests by batching log messages",
        @"<pre>&lt;ajaxAppender name=""appender1"" batchSize=""3""/&gt;</pre>
")

    @Feature(
        "",
        @"Only log for certain user agents or IP addresses",
        @"<pre>&lt;logger userAgentRegex=&quot;MSIE 7|MSIE 8&quot; /&gt;</pre>
")

    @Feature(
        "",
        @"Log objects as well as strings",
        @"<pre>var obj = {""f1"": ""v1"", ""f2"": ""v2""};
JL().log(2500, obj);</pre>
")

    @Feature(
        "",
        @"Pass in function that returns log info",
        @"<pre>JL().log(2500, function() { 
    // Only executed when log info 
    // will actually be logged.
    var loginfo = expensiveOperation();
    return loginfo; 
});</pre>
")

    @Feature(
        "",
        @"Suppress messages that match a regular expression",
        @"<pre>&lt;logger disallow=""suppress me"" /&gt;</pre>
")

    </div>
    <div class="rightColumn">

    @Feature(
        "",
        @"Store client side log messages in your server side logs",
        @"
<table class=""log"">
<tr><th style=""width: 120px"">Logger</th><th>Message</th></tr>
<tr><td>csLogger</td><td>Server side error message</td></tr>
<tr><td>jsLogger</td><td>Client side fatal message</td></tr>
<tr><td>csLogger2</td><td>Server side info message</td></tr>
<tr><td colspan=""2"">...</td></tr>
</table>
")

    @Feature(
        "",<commit_msg>Versioning home page - features<commit_after>﻿@using ViewExtensions
@using WebSite.App_Code

@{
    ViewBag.Title = "Better JavaScript Logging";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section Hero {
    <section class="hero large-text">
        <section class="benefits" style="float: left; width: 650px; margin-top: 5px;">
@if (PageVersions.CurrentVersion() == "NetJs")
{
            <h1>Client side logging integrated with ASP.NET and MVC</h1>
            <p>


            JSNLog lets you insert loggers in your client side JavaScript,
            configure them in your web.config, and store their messages
            in your server side logs - without any server side coding.
            </p>
}
@if (PageVersions.CurrentVersion() == "JsOnly")
{
            <h1>JavaScript logging redone</h1>
            <p>
                small
                simple
                efficient - reduce bandwidth
                easy to integrate with server
                easy to use
                well documented



            JSNLog lets you insert loggers in your client side JavaScript,
            configure them in your web.config, and store their messages
            in your server side logs - without any server side coding.
            </p>
}
        </section>
<div class="download" style="float: right; margin-bottom: 10px;"> 
        @Html.Raw(Html.Partial("Partials/_DownloadButton").ToHtmlString())
        </div>

        @if (PageVersions.CurrentVersion() == "NetJs")
        {
            <div class="nugetline">PM> Install-Package JSNLog</div>
        }

    </section>
}

<section class="features">
    <div class="leftColumn">

@if (PageVersions.CurrentVersion() == "NetJs")
{
    @Feature(
        "",
        @"Works with your server side loggers",
        @"<ul class=""halfspaced"">
        <li>
Sends log messages from the client to the server using AJAX.
        </li>
        <li>
Hands the log messages to your server side logging package.
        </li>
        <li>
Supports Log4Net, NLog, Elmah, Common.Logging.
        </li>
        </ul>")
}

        @Feature(
            "",
            @"Insert loggers in your JavaScript",
            @"<pre>JL(""jsLogger"").fatal(""log message"");</pre>")

@if (PageVersions.CurrentVersion() == "NetJs")
{
    @Feature(
        "",
        @"Configure loggers in your web.config",
        @"<pre>&lt;logger name=""jslogger"" level=""FATAL"" /&gt;</pre>
")
}

@if (PageVersions.CurrentVersion() == "NetJs")
{
    @Feature(
        "",
        @"Or configure them in your JavaScript code",
        @"<pre>JL(""jsLogger"").setOptions({ ""level"": 4000 });</pre>
")
}
@if (PageVersions.CurrentVersion() == "JsOnly")
{
    @Feature(
        "",
        @"Configure loggers in your JavaScript code",
        @"<pre>JL(""jsLogger"").setOptions({ ""level"": 4000 });</pre>
")
}

@*===========================================================*@

@if (PageVersions.CurrentVersion() == "NetJs")
{
    @Feature(
        "",
        @"Reduce AJAX requests by batching log messages",
        @"<pre>&lt;ajaxAppender name=""appender1"" batchSize=""3""/&gt;</pre>
")
}
@if (PageVersions.CurrentVersion() == "JsOnly")
{
    @Feature(
        "",
        @"Reduce AJAX requests by batching log messages",
        @"<pre>appender.setOptions({ ""batchSize"": 3 });</pre>
")
}

@*===========================================================*@

@if (PageVersions.CurrentVersion() == "NetJs")
{
    @Feature(
        "",
        @"Only log for certain user agents or IP addresses",
        @"<pre>&lt;logger userAgentRegex=&quot;MSIE 7|MSIE 8&quot; /&gt;</pre>
")
}
@if (PageVersions.CurrentVersion() == "JsOnly")
{
    @Feature(
        "",
        @"Configure loggers in your JavaScript code",
        @"<pre>JL().setOptions({ ""userAgentRegex"": ""MSIE 7|MSIE 8"" });</pre>
")
}

@*===========================================================*@

    @Feature(
        "",
        @"Log objects as well as strings",
        @"<pre>var obj = {""f1"": ""v1"", ""f2"": ""v2""};
JL().log(2500, obj);</pre>
")

    @Feature(
        "",
        @"Pass in function that returns log info",
        @"<pre>JL().log(2500, function() { 
    // Only executed when log info 
    // will actually be logged.
    var loginfo = expensiveOperation();
    return loginfo; 
});</pre>
")

@if (PageVersions.CurrentVersion() == "NetJs")
{
    @Feature(
        "",
        @"Suppress messages that match a regular expression",
        @"<pre>&lt;logger disallow=""suppress me"" /&gt;</pre>
")
}
@if (PageVersions.CurrentVersion() == "JsOnly")
{
    @Feature(
        "",
        @"Suppress messages that match a regular expression",
        @"<pre>JL(""jsLogger"").setOptions({ ""disallow"": ""suppress me"" });</pre>
")
}

    </div>
    <div class="rightColumn">

@if (PageVersions.CurrentVersion() == "NetJs")
{
    @Feature(
        "",
        @"Store client side log messages in your server side logs",
        @"
<table class=""log"">
<tr><th style=""width: 120px"">Logger</th><th>Message</th></tr>
<tr><td>csLogger</td><td>Server side error message</td></tr>
<tr><td>jsLogger</td><td>Client side fatal message</td></tr>
<tr><td>csLogger2</td><td>Server side info message</td></tr>
<tr><td colspan=""2"">...</td></tr>
</table>
")
}

    @Feature(
        "",
{'fraction_non_alphanumeric': 0.19217330538085256, 'fraction_numerical': 0.008968087584439786, 'mean_word_length': 2.573449854348731, 'pattern_counts': {'":': 10, '<': 155, '<?xml version=': 0, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1531860', 'n_tokens_mistral': 2768, 'n_tokens_neox': 2624, 'n_words': 677}