Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This page has been translated automatically

We want to provide you with the latest help content in your language as soon as possible. This page has been translated automatically and may contain grammatical errors or inaccuracies. We want this content to be useful to you. Please let us know at the bottom of this page if this information was helpful.

View the original article in Russian: Окно лога

Description

The log is used to display messages to the user. The message can be of one of three types:

  • informational (“Getting started”, “Getting started”, “Successfully created an account”, etc.)

  • warning (any non-critical errors in the template)

  • erroneous (when it is necessary to inform the user that there has been a serious error in the work that needs to be paid attention to).

Among other things, these three types of messages differ in icons:

Messages are output to the log using the Alert action .

What is it used for?

Let's say that you have created a template that takes about 8 minutes to run once. You don't log at all. You run the template and it works great for one execution, two, three, five, ten. But on the 11th execution, the pattern “hangs” - it does not succeed, but it does not exit with an error, and so on for 10, 20, 30 minutes. In such a situation, you have to forcibly terminate the program and restart the template, hoping that this situation will never happen again.

On the other hand, you can add the output of messages to the log to the template so that you can clearly see at what stage the execution is now. And if the template hangs somewhere, then according to the log we can understand in what, approximately, place the error.

If it seems to you that too many messages are being written to the ZennoPoster log, and you would not want to completely delete actions, you can make them appear only in ProjectMaker. To do this, in the Action Alert you need to uncheck the "Show in ZennoPoster" checkbox.

How to work with a window?

Enabling the log window

To enable it, click on the Window item in the top menu and select the Log item :

 If the log window is not displayed

There are cases when the log window is not displayed, although there is a checkbox next to it in the settings (as shown in the screenshot above), indicating that it is enabled. If, after several attempts to enable it, it still does not appear, then you can perform a general reset of the windows settings in ProjectMaker.

ATTENTION! The steps described below will reset the window settings, in other words, if you have customized the program interface for yourself by arranging its windows in a way convenient for you, then all these settings will be deleted and the default value will be set.

Заходим в настройки (Редактирование-Настройки), выбираем вкладку Отладка и в самом низу окна ищем кнопку Сбросить панели. After clicking this button and restarting ProjectMaker, all window settings will be reset, but enabling the log window should work correctly (this method can also be used in case of problems with displaying other program windows).


Appearance (Standard log)

  1. The main message display window. First, the icon corresponding to the message type is displayed, then the message time and the actual message text.

  2. Using the buttons in this section, you can filter the displayed messages by their type.

  3. “Autoscroll” - if this option is enabled, the log window will automatically scroll, thus always showing the most recent message.

  4. “Auto-fit line height” - if the message is too large, then the line height will be adjusted in such a way to completely fit it. If this option is disabled, then only the top line of this entire message will be displayed.

  5. With this button you can clear the window from all messages.


Buttons from the right block of the window are minimized when the height of the log window decreases. To get access to them, you need to click on the corresponding button.


The features described below are for advanced users.

Log file on computer

PorjectMaker and ZennoPoster additionally save logs on the computer in the directory with the installed program, in the Logs folder. This is how the path to this folder C: \ Program Files \ ZennoLab \ RU \ ZennoPoster Pro V7 \ 7.1.6.1 \ Progs \ Logs might look like

Splitting by patterns and streams

By default, all logs from all templates are written to one file. This behavior can be changed using C # code , which must be placed at the beginning of the template:

// Перенаправляем лог для данного шаблона в отдельный  файл.
project.LogOptions.LogFile = @"D:\log.txt";
// Для каждого потока будет создан свой лог файл.
// К имени файлов (в нашем случае log) будут приписываться идентификаторы потоков.
project.LogOptions.SplitLogByThread = true;

Extended version of the log

В настройках программы можно включить Расширенный лог. Для этого в верхнем меню кликаем по Редактирование затем Настройки, после выбираем вкладку Отладка и ищем пункт Расширенный вариант окна лога. For the changes to take effect, you must restart ProjectMaker.

When you enable extended logging in ProjectMaker, it will automatically be enabled in ZennoPoster.

The appearance of the extended log window

The first thing that catches your eye is the appearance of headings:

  • Message type.

  • Time.

  • An unnamed title (in the 5.H.H.X version it was called the Way ).

  • Message.

By clicking on any header, you can sort messages in the log

Message filter

When you hover the mouse cursor over any of the headings, a filter icon appears.

The type of filter depends on the column in which the click was made:

  • date filters will be available for the Time column (you can display messages for a specific day, between two dates, before or after a specified date, and many other filters. Or you can create a complex filter with several conditions)

 Screenshots



  • text filters will be available for the Messages column and for the Nameless one .

 Screenshots and filter translations

Equals - String equal to filter (exact match)

Does Not Equal - NOT equal to filter

Begins With - Starts with ...

Ends With - Ends With ...

Contains - Contains

Does Not Contain - Does Not Contain

Is Blank - The line is empty

Is Not Blank - NOT an empty string

Custom - Composite filter.

Auto filter and filter constructor

Right-clicking on the title will open a context menu with additional functions: grouping by the selected column, hiding columns. selection of width. Among them, we are now more interested in Auto Filter and Filter Designer.

Auto Filter - This allows you to quickly create a simple message filter. When activated, an additional line (1) appears under the headings, in which the type of filter is set and you can enter the necessary characters and \ or words according to which the displayed messages will be selected. The screenshot below shows the line that appears and a simple filtering is created (2) - only those lines that contain the “o” symbol are displayed (the search is performed by the Message column). Each line, on the left, has an icon, after clicking on which a context menu (3) appears with a choice of the type of filtration. The types of filters and the entered values depend on the type of the column: for the Time column, these are comparison operators (greater than ->, less than - <, equal to - =, etc.) and dates; for Messages - text search (Contains, does not contain, starts with, etc.) plus comparison operators.

Filter Builder - similar to an auto filter, but allows you to create much more complex filtering conditions.

  1. When you click on this button, you can add a new condition, a group of conditions, or completely clear all search conditions. It is also necessary to define a logical connection between the conditions here:

    1. AND - meet ALL conditions

    2. OR - satisfy at least one of the conditions

    3. NOT AND - DO NOT meet ALL conditions

    4. NOT OR - DO NOT satisfy at least one of the conditions

  2. Using this button, you can easily add an additional condition.

  3. The column to which the filter is applied is indicated in blue in square brackets (in the screenshot, in the last condition, empty brackets are the Untitled column. Although she does not have her own name, you can filter by her).

  4. The filter type is displayed in green.

  5. Black text is user input for the filter.

  6. This button makes it easy to remove the filter.

How to write in an unnamed column (and why you might need it)?

Unfortunately, it is impossible to write to this column using the standard Alert action (at the time of this writing, the latest version of the program is 7.1.6.1). To do this, you must use the Custom C # code cube and have minimal knowledge of working with C # code.

There are three methods for displaying messages in the log - project.SendInfoToLog, project.SendWarningToLog, project.SendErrorToLog. Each of these methods has an overload (the work in all three methods is identical, so here we will only consider project.SendInfoToLog )

// Первый вариант метода.
// Аргументы:
// 1й - строка, которая выведется в колонке "Сообщение"
// 2й - bool, надо ли выводить это сообщение в лог ZennoPoster
project.SendInfoToLog("Message", true);

// Второй вариант:
// Аргументы:
// 1й - строка, которая выведется в колонке "Сообщение"
// 2й - строка, данная строка появится в  безымянной колонке.
// 3й - bool, надо ли выводить это сообщение в лог ZennoPoster
project.SendInfoToLog("Message", "Way", true);

This is what the call to this code looks like:

Where it can come in handy:

  • in multithreaded work, you can enter the account name in the Untitled column, and the action that this account is currently performing in Messages . If the need arises, you can either group messages by this column (this is done by right-clicking on the title and selecting the appropriate option), or set up a filter.

  • it may be necessary to write large templates that perform many functions in one pass, for example - registration, filling out a profile, searching for a product, parsing and processing goods, publishing processed data (and all this is one template execution). Each of the described parts can contain many actions. So when logging into the Nameless column, you can write that part of the template in which the execution is now located, and write a specific action in Messages .

  • No labels